void main(void) { uint8 appMode = NONE; // Config basicRF basicRfConfig.panId = PAN_ID; basicRfConfig.channel = RF_CHANNEL; basicRfConfig.ackRequest = TRUE; #ifdef SECURITY_CCM basicRfConfig.securityKey = key; #endif // Initalise board peripherals 初始化外围设备 ; ; // Initalise hal_rf 硬件抽象层的rf进行初始化 if(halRfInit()==FAILED) { HAL_ASSERT(FALSE); } // Indicate that device is powered halLedSet(2); //关闭LED2 halLedSet(1); //关闭LED1 /*********************************************** // Print Logo and splash screen on LCD utilPrintLogo("Light Switch"); // Wait for user to press S1 to enter menu while (halButtonPushed()!=HAL_BUTTON_1); halMcuWaitMs(350); halLcdClear(); // Set application role appMode = appSelectMode(); halLcdClear(); // Transmitter application if(appMode == SWITCH) { // No return from here appSwitch(); } // Receiver application else if(appMode == LIGHT) { // No return from here appLight(); } ************************************/ /************Select one and shield to another***********by boo*/ ; //节点为按键S1 P0_4 ; //节点为指示灯LED1 P1_0 // Role is undefined. This code should not be reached HAL_ASSERT(FALSE); }