void Speaker_SetInterface(void) { { if(pInformation->USBwValue == 0x0000){ // Turn off LED Led1Off(); bCameraOn = 0; //GPIOF->BSRR = GPIO_Pin_6; }else{ // Turn ON LED //GPIOF->BRR = GPIO_Pin_6; Led1On(); bCameraOn = 1; } } }
/** Main program entry point. This routine configures the hardware required by the application, then * enters a loop to run the application tasks in sequence. */ int main(void) { //RFCOMM_SendFrame(0x10003000,0x10003004,4,4,130,0x10003200); uint16_t tick; SetupHardware(); LPC_TIM0->TCR = 1; Led1On(); Led2On(); Led1Off(); Led2Off(); EVENT_USB_Host_DeviceUnattached(); for (;;) { //uint8_t ButtonStatus = Buttons_GetStateMask(); /* Check if the system update interval has elapsed */ if(LPC_TIM0->IR &0x01) { /* Clear the timer compare flag */ LPC_TIM0->IR |= 0x01; if (RFCOMM_SensorStream){ Led1On(); } else{ if(tick++>=50) { tick = 0; Led1Not(); } } /* If the bluetooth stack is active, manage timeouts within each layer */ BluetoothAdapter_TickElapsed(); KeyScan(); if(sendFlag){ rfcomm_send_data(); } } BluetoothAdapter_USBTask(); USB_USBTask(); } }
void Main(void) { InterruptInit(); IntDisableAll(); Platform_Init(); TS_Init(); /* Init the kernel. */ TMR_Init(); /* Init the TMR module */ NvModuleInit(); Uart_ModuleInit(); /* This only creates the MAC TS thread. */ MacInit(); /* Use TS for MAC - the MAC TS ID must be known at this step. */ Init_802_15_4(TRUE); #if gZtcIncluded_d Ztc_TaskInit(); #endif /* gZtcIncluded_d */ /*initialize the application*/ gAppTaskID_c = TS_CreateTask(gTsAppTaskPriority_c, AppTask); MApp_init(); #if (gLpmIncluded_d == 1) /*do not allow the device to enter sleep mode*/ PWR_DisallowDeviceToSleep(); #endif /* gLpmIncluded_d == 1 */ /*All LED's are switched OFF*/ Led1Off(); Led2Off(); Led3Off(); Led4Off(); /* Start the task scheduler. Does not return. */ TS_Scheduler(); }