int main(void) { Led_Init(LED0); Led_Disable(LED0); Led_Init(LED1); Led_Disable(LED1); while(1) { Led_Enable(LED1); SysTick_Delay(500); Led_Disable(LED1); SysTick_Delay(500); } }
void assert_failed(uint8_t* file, uint32_t line) { Led_t blueLed; Led_Init(&blueLed, GPIOC, GPIO_Pin_8); Led_SetState(&blueLed, led_on); while(1); }
int main(void) { DAC_MCP4921_Init(); char uartReceiverBuffer[RECEIVER_SIZE]; UART_InitWithInt(9600); Led_Init(); //DEBUG while(1) { if(eReciever_GetStatus()==READY) { Reciever_GetStringCopy(uartReceiverBuffer); DecodeMsg(uartReceiverBuffer); if((ucTokenNr!=0)&&(asToken[0].eType==KEYWORD)) { switch(asToken[0].uValue.eKeyword) { case DACSET: if((asToken[1].eType==NUMBER)&&(asToken[1].uValue.uiNumber<0x0FFF)) DAC_MCP4921_Set_Adv(asToken[1].uValue.uiNumber); //Led_StepRight(); break; default: break; } } } //if(Transmiter_GetStatus()==FREE){ // displayWatchValue(); //} } return 0; }
int main(void) { // uint32_t pre = 0 ; uint8_t* p = 0; timer_config(); SPIx_Init(); Led_Init(); Key_Init(); Usart2_Init(9600); // enc28j60_init(mac); install_uart_dev(); stack_init(); // test_hardhandler(2,(int*)1); my_tftp_init(); telnet_service_init(); // web_server_init(); // *p = 1 ; #if 0 while(1) { stack_process(); Led_Process(); shell(); } #endif bootstart(); return 0 ; }
///////////////////////////////////////////////////////////////////////// /// \brief the first user code function to be called after the ARM M0 /// has initial. ///////////////////////////////////////////////////////////////////////// void main(void) { uint8_t TempData; FIFO_Initialiser(); Led_Init(); Tick_init(); SerialPort2.Open(115200); for ( ;; ) { if(SerialPort2.GetByte(&TempData)) { if( FALSE == FIFO_Write(TempData) ) { SerialPort2.SendString("Buffer is full"); FIFO_Initialiser(); } SerialPort2.SendByte(TempData); Led_Toggle(); } } }
/////////////////////////////////////////////////////////////////////////////// /// \brief Init the terminal program /////////////////////////////////////////////////////////////////////////////// void Terminal_Init(void) { Led_Init(); Tick_init(); SerialPort2.Open(115200); NumberOfByteReceived = 0; DisplaySystemInformation(); }
int main (){ unsigned int iMainLoopCtr; KeyboardInit(); Led_Init(); DetectorInit(); Timer1Interrupts_Init(250000,&Automat); while(1){ iMainLoopCtr++; } }
int main(void) { I2C_Init(); Led_Init(); //for debug char uartReceiverBuffer[RECEIVER_SIZE]; //UART_InitWithInt(9600); Timer0Interrupts_Init(1000000, setPortPcf8574); while(1){}; return 0; }
int main(void) { //SysTick_Init(); Led_Init(); Usart1_Init(); while(1) { Led_Process(); } }
int Main() { Led_Init() ; while(1) { Led1_On() ;Delay() ;Led1_Off() ; Led2_On() ;Delay() ;Led2_Off() ; Led3_On() ;Delay() ;Led3_Off() ; Led4_On() ;Delay() ;Led4_Off() ; } return 0; }
void BSP_Init(void) { /*************** System Init *********************/ RInit(); /**************** NVIC Init **********************/ NVIC_Configuration(); /***************** Bsp Init **********************/ SysTest_Bsp_Init(); LcdMainInit(); Led_Init(); ADC_InitChannel(); VoltageSampleInit();// ADC }
///////////////////////////////////////////////////////////////////////// /// \brief the first user code function to be called after the ARM M0 /// has initial. ///////////////////////////////////////////////////////////////////////// void main(void) { Led_Init(); Tick_init(); SerialPort2.Open(115200); SerialPort2.SendString((uint8_t *)"Hello World!\r\n"); for ( ;; ) { Tick_DelayMs(500); // Delay for 500ms = 1/2s Led_Toggle(); // Toggle the LED. This should cause the LED to turn on every second } }
void Main(void) { Uart0_Init_all(); Led_Init() ; Uart_Printf("\n%s\n", "Led相关引脚已经初始化完毕!请按任意键开始闪烁"); Uart_Getch(); while(1) { rGPFDAT &= 0x0F; Uart_Printf("\n%s\n", "Led亮"); delay(); rGPFDAT |= 0xFF; Uart_Printf("\n%s\n", "Led灭"); delay(); } }
/* ===================================================================*/ void GPIOInit(void) { /* * Initialize Port DRDY for input from MPU6050. * Low when mpu6050 is ready to be read. * Meanwhile, an interrupt will be triggered on falling edge * calling MCU to read data from mpu6050. */ MPU6050_DRDY_Init(NULL); /* * Initialize PortA4 , the led indicates the calibration of mag */ Led_Init(NULL); }
int main(void) { UART_Init(); microrl_terminalInit(); LoggerHAL_Init(); CommandLine_Init(); logger_Test(); Led_t greenLed; Led_Init(&greenLed, GPIOC, GPIO_Pin_9); Led_SetState(&greenLed, led_on); while(1) { microrl_terminalProcess(); } }
///////////////////////////////////////////////////////////////////////// /// \brief the first user code function to be called after the ARM M0 /// has initial. ///////////////////////////////////////////////////////////////////////// void main(void) { uint_fast8_t FifoReadReturnValue; uint8_t TempData; FIFO_Initialiser(); Led_Init(); Tick_init(); SerialPort2.Open(115200); for ( ;; ) { if(SerialPort2.GetByte(&TempData)) { if( FALSE == FIFO_Write(TempData) ) { FifoReadReturnValue = TRUE; for( ; FifoReadReturnValue; ) { FifoReadReturnValue = FIFO_Read(&TempData); if( ERROR == FifoReadReturnValue ) { break; } else if( TRUE == FifoReadReturnValue ) { SerialPort2.SendByte(TempData); } } } Led_Toggle(); } } }
int main (){ unsigned int iMainLoopCtr; KeyboardInit(); Led_Init(); DetectorInit(); sServo.eState=CALLIB; Timer1Interrupts_Init(60000,&Automat); while(1){ iMainLoopCtr++; switch(eKeyboard_Read()){ case BUTTON_1:sServo.eState=CALLIB; break; case BUTTON_2:sServo.uiDesiredPosition=50; break; case BUTTON_3:sServo.uiDesiredPosition=100; break; case BUTTON_4:sServo.uiDesiredPosition=150; break; default: break; } } }
void Servo_Init(unsigned int uiServoFrequency) { Led_Init(); DetectorInit(); Timer1Interrupts_Init(uiServoFrequency,&Automat); }