/**************************************************************************** NAME handleAppInit DESCRIPTION Handles the application initialised message. */ static void handleAppInitCfm(void) { mvdAppState app_state = the_app->app_state; switch( app_state ) { case AppStateInitialising: { /* ConnectionWriteClassOfDevice(AV_MAJOR_DEVICE_CLASS | AV_MINOR_HIFI | AV_COD_CAPTURE);*/ ConnectionWriteClassOfDevice(0x40020C); /* handset */ /* now allow buttons */ pioInit(&the_app->pio_states, &the_app->task ) ; the_app->audioAdaptorPoweredOn = TRUE; /* initSync();*/ setAppState(AppStateIdle); UartPrintf("\r\nReady\r\n"); break; } default: { unexpectedAppMessage(APP_INIT_CFM, app_state); } } }
int main(void) { //Turn off LED pioInit(); pinMode(LEDPIN, OUTPUT); digitalWrite(LEDPIN, 0); //Print header and redirect printf("%s%c%c\n", "Content-Type:text/html;charset=iso-8859-1",13,10); printf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;url=/index.html\">"); return 0; }
static void hal_initialising_state_enter(void) { DEBUG(("hal initialising state enter...\n")); /** init pio **/ pioInit(&hal.pio_state, getHalTask()); /** init battery lib, set 0 to read once **/ /*BatteryInit(&hal.battery_state, getHalTask(), BATTERY_READING_SOURCE, BATTERY_POLLING_PERIOD);*/ BatteryInit(&hal.battery_state, getHalTask(), BATTERY_READING_SOURCE, 0); /** floating, if user release button and power cable unplugged, system stop **/ disableLDO(); update_indication(); }
static int pioInit_fwrap(int commSuper, int nProcsIO, int IOMode, int *pioNamespace, float partInflate, void (*postCommSetupActions)(void)) { MPI_Comm v; v = pioInit(MPI_Comm_f2c(commSuper), nProcsIO, IOMode, pioNamespace, partInflate, postCommSetupActions); return MPI_Comm_c2f(v); }
int main() { pioInit(); pinMode(22, OUTPUT); digitalWrite(22, 0); }