/** * @brief This function handles External line 0 interrupt request. * @param None * @retval None */ void BUSY_IRQHandler(void) { if(EXTI_GetITStatus(BUSY_EXTILINE) != RESET) { Led_Toggle(LED1); Led_Toggle(LED2); /* Clear the EXTI line 0 pending bit */ EXTI_ClearITPendingBit(BUSY_EXTILINE); AD7606_Read(); } }
///////////////////////////////////////////////////////////////////////// /// \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(); } } }
void MOTOR_IRQHandler(void) { // uint32_t Period[60] = {200,400,600,800,1000,1200,1400,1600,1800,2000,2200,2400,2600,2800,3000,3200,3400,3600,3800,4000,}; if(TIM_GetITStatus(MOTOR_TIM, TIM_IT_Update) != RESET) { TIM_ClearITPendingBit(MOTOR_TIM , TIM_FLAG_Update); Led_Toggle(LED1); EFF_MOTOR(); } }
///////////////////////////////////////////////////////////////////////// /// \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 } }
///////////////////////////////////////////////////////////////////////// /// \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(); } } }
void heartBeat(TRG_CallBackDataPtr data) { TRG_SetTrigger(TRG_HEARTBEAT, 500, &heartBeat, NULL); Led_Toggle(led1); Led_Toggle(led2); }