unsigned char isThereTemperatureReady() { if(waitNRF()==0) { getTemp(); setAddr(17, 2); showTemp(); NRF_down(); return 1; }; return 0; };
void main(void) { /* Clock configuration -----------------------------------------*/ CLK_Config(); /* GPIO configuration ------------------------------------------*/ GPIO_Config_Init(); TIM3_Config(); TIM4_Config(); UART1_Config(); UART3_Config(); enableInterrupts(); DeviceStatus.workState = 16; Delay(200); //beep Set_Beep_OptionByte(); Beep_Init(BEEP_FREQUENCY_4KHZ); BEEP_LSICalibrationConfig(LSI_128kHz); showAll(); PowerOnBeep(); clear(); TIM2_Config(); showTemp(Temperature[DeviceStatus.workState], ON); showSymbol(SYMBOL_DEFAULT); FunctionReport(DeviceStatus.workState); while (1) { if(DeviceStatus.Time_100ms == 1) { if(UART1_GetFlagStatus(UART1_FLAG_IDLE) == SET) { if(DataSize != 0) { DataResolve(RxRecvBuffer, DataSize); DataSize = 0; } } DeviceStatus.Time_100ms = 0; } } }