示例#1
0
void init( int argc, char * argv[] )
{
    if(argc > 1)
        if(Serial.init_tty(argv[1]) != 0)
            return;

    if(Serial1.init_tty(LINUX_SERIAL1_TTY) != 0)
        return;
    if(Serial2.init_tty(LINUX_SERIAL2_TTY) != 0)
        return;

    sizeof_g_APinDescription = sizeof(g_APinDescription)/sizeof(struct _PinDescription);
    sizeof_g_APinState = sizeof(g_APinState)/sizeof(struct _PinState);
    pinInit();

    /* Initialize fast path to GPIO */
    if (fastGpioPciInit())
        trace_error("Unable to initialize fast GPIO mode!");

    sizeof_g_APwmDescription = sizeof(g_APwmDescription)/sizeof(struct _PwmDescription);
    pwmInit();

    sizeof_g_AdcDescription = sizeof(g_AdcDescription)/sizeof(struct _AdcDescription);
    adcInit();

    eepromInit();
}
示例#2
0
void init( int argc, char * argv[] )
{
	if(argc > 1)
		if(Serial.init_tty(argv[1]) != 0)
			return;

	if(Serial1.init_tty(LINUX_SERIAL1_TTY) != 0)
		return;

	if(Serial2.init_tty(LINUX_SERIAL2_TTY) != 0)
		return;

	sizeof_g_APinDescription = sizeof(g_APinDescription)/sizeof(struct _PinDescription);
	pinInit();
	sizeof_g_APwmDescription = sizeof(g_APwmDescription)/sizeof(struct _PwmDescription);
	pwmInit();
	sizeof_g_AdcDescription = sizeof(g_AdcDescription)/sizeof(struct _AdcDescription);
	adcInit();
	sizeof_g_APinState = sizeof(g_APinState)/sizeof(struct _PinState);
}