void UserMain( void * pd ) { initWithWeb(); EnableSmartTraps(); iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag()); iprintf("FlashCompare: %s\n", FlashCompare( SPI_Config_Base, (const uint8_t *)&gConfigRec, GCSTORE_SIZE) == 0 ? "Success" : "Failure"); iprintf("FlashCompare: %s\n", FlashCompare( SPI_Config_Base, ((const uint8_t *)&gConfigRec)+1, GCSTORE_SIZE) == 0 ? "Success" : "Failure"); while(1) { OSTimeDly(TICKS_PER_SECOND); } }
void UserMain( void * pd ) { initWithWeb(); Nunchuck_Init(); // FIXME LLInit(1); TheWSHandler = MyDoWSUpgrade; stepper.Init(); ConfigureStepper( &stepper, 1 ); stepSpeed = 100; stepDir = 1; StartStepper( 1, stepDir, stepSpeed ); stepForever = true; OSSemInit( &SockReadySem, 0 ); OSCritInit( &I2CLock ); iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag()); OSTimeDly(2); OSSimpleTaskCreate(ReportTask, 5); OSSimpleTaskCreate(InputTask, MAIN_PRIO-1); OSSimpleTaskCreate(RangingTask, 2); EnableEncoder(EncodeStep, ButtonChange, ButtonDoubleClick ); ClearTaskTimes(); SMPoolPtr pp; while(1) { fd_set error_fds; FD_ZERO( &error_fds ); OSCritEnter( &I2CLock, 0 ); nun.Update(); OSCritLeave( &I2CLock ); serv_x.SetPos(nun.stick.x); serv_y.SetPos(nun.stick.y); // iprintf("%lu\na_x: %4.4d - a_y: %4.4d - a_z: %4.4d\ns_x: %3.3d - s_y: %3.3d - b_z: %d - b_c: %d\n\n", // TimeTick, nun.accel.x, nun.accel.y, nun.accel.z, // nun.stick.x, nun.stick.y, // nun.button.z, nun.button.c); // iprintf("range: %u\n", lidarRange); if (ws_fd > 0){ SendConfigReport(ws_fd); } } }
void UserMain( void * pd ) { Config(); initWithWeb(); EnableSmartTraps(); iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag()); getchar(); EnableTrace(CS_NUM); while(1) { // for (uint16_t i = 0; i < 512; i++) { // trace = i; // } iprintf("SR: 0x%04X\n", GetSR_IntLevel()); OSTimeDly(TICKS_PER_SECOND); } }
extern "C" void UserMain( void * pd ) { initWithWeb(); iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag()); if ( EnableMultiPartForms( MAX_FILE_SIZE ) ) { iprintf("Allocated %ld bytes of memory for MultiPart Forms\r\n",(DWORD)MAX_FILE_SIZE ); iprintf("Maximum file path length: %d\r\n", (WORD)MAX_PATH_LEN ); SetNewPostHandler( MyDoPost ); } else { iprintf( "Could not allocate MultiPart Form memory\r\n" ); } while (1) { OSTimeDly(TICKS_PER_SECOND); } }