Example #1
0
int __init vtmodule_init(void)
{
	int i = 0;
	debug_i("vmodule_init called entered");
	/* extra safe initialization */
	vtouch_dev = input_allocate_device();

	/* set up descriptive labels */
	vtouch_dev->name = "Ineda Virtual Touch";
	/* phys is unique on a running system */
	vtouch_dev->phys = "No Physical Path";
	vtouch_dev->id.bustype = BUS_HOST;
	vtouch_dev->id.vendor = 0x0001;

	vtouch_dev->id.product = 0x0001;
	vtouch_dev->id.version = 0x0100;


	vtouch_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
	vtouch_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
	input_set_abs_params(vtouch_dev, ABS_X, 0, 1280, 0, 0);
	input_set_abs_params(vtouch_dev, ABS_Y, 0, 1024, 0, 0);

//	input_set_abs_params(vtouch_dev, ABS_PRESSURE, 1,
//	                     0, 0, 0);

	/* and finally register with the input core */

	i = input_register_device(vtouch_dev);
	debug_i("vmodule_init called exited %d",i);
	return 0;
}
Example #2
0
int main (int argc, char *argv[])
{
    int rc = 0;
    char *result_xml;

    verbose_level = 3;
    
    sqlite3 *db;
    const char *err;
    suns_parser_init();

    suns_parse_model_file("../models/device.model");

    if (suns_output_sqlite_open("store.db", &db, &err) < 0) {
        error("sqlite: %s", err);
        return 1;
    }

    /* suns_output_sqlite_init_db(db, &err); */

    list_t *devices = list_new();
    suns_host_result_t *result = suns_host_result_new();

    rc = suns_host_parse_logger_xml(stdin, devices, result);

    if (rc < 0) {
        debug("rc = %d\n", rc);
    }
    
    list_node_t *c;
    suns_device_t *d;
    list_for_each(devices, c) {
        d = c->data;
        /*        sqlite3_int64 rowid; */
        rc = suns_output_sqlite_device(db, d, &err);
        debug_i(rc);
    }
Example #3
0
void init()
{
	Serial.begin(SERIAL_BAUD_RATE); // 115200 by default

	/*There are four debug levels: debug=3, info=2, warn=1, error=0
	 * You can set the debug level by making with DEBUG_VERBOSE_LEVEL
	 * set to the desired level (0-3). Ex make rebuild DEBUG_VERBOSE_LEVEL=2 will
	 * show only info messages and above, will not show debug messages
	 * (they will be removed from the build at compile time, saving flash space)
	 *
	 * Functions debugf, debug_d, debug_i, debug_w, and debug_e store the format string
	 * in flash so that the RAM is freed for more important information.
	 *
	 * Another useful feature is printing the filename and line number of every debug line
	 * This will require extra space on flash and can be enabled
	 * using make parameter PRINT_FILENAME_AND_LINE=1*/

	debug_d("(DEBUG) message printed on UART0");

	debug_i("(INFO) message printed on UART0");

	debug_w("(WARNING) message printed on UART0");

	debug_e("(ERROR) message printed on UART0");

	/*debugf is equivalent to debug_i*/
	debugf("(INFO) message printed with debugf on UART0");

	/*
	 * Notice: The line below disables the debugf output on all UARTs.
	 */
	Serial.systemDebugOutput(false);

	debugf("(DEBUG) don't print me at all");

	/*
	 * The debugf output is redirected to UART0
	 * together with the system debug messages.
	 */
	Serial.systemDebugOutput(true);
	delay(200);

	debugf("(DEBUG) print me again on UART0");

	/**
	 * Serial1 uses UART1, TX pin is GPIO2.
	 * UART1 can not be used to receive data because normally
	 * it's RX pin is occupied for flash chip connection.
	 *
	 * If you have a spare serial to USB converter do the following to see the
	 * messages printed on UART1:
	 * - connect converter GND to esp8266 GND
	 * - connect converter RX to esp8266 GPIO2
	 */
	HardwareSerial Serial1(UART1);
	Serial1.begin(SERIAL_BAUD_RATE);

	/*
	 * The line below redirect debug output to UART1
	 */
	Serial1.systemDebugOutput(true);
	Serial1.printf("====Debug Information=====\n");

	debugf("(DEBUG) message printed on UART1"); // You should see the debug message in UART1 only.

	procTimer.initializeMs(2000, sayHello).start();

	testPrintf();

	/// Reading callback example:
	//  * Option 1
	//	Set Serial Callback to global routine:
	//	   Serial.setCallback(onDataCallback);
	// If you want to test local echo set the following callback
	//	   Serial.setCallback(echoCallback);

	// 	* Option 2
	//  Instantiate hwsDelegateDemo which includes Serial Delegate class
	delegateDemoClass.begin();
}
Example #4
0
void __exit vtmodule_exit(void)
{
	debug_i("vmodule_exit called entered");
	input_unregister_device(vtouch_dev);
	debug_i("vmodule_exit called exited");
}