Es un backup para las pruebas de firmware y hardware de un ventilador
Dependencies: mbed QEI FastPWM
main.cpp
- Committer:
- miguelangel_2511
- Date:
- 2020-04-17
- Revision:
- 3:45299e7882b9
- Parent:
- 1:aa5df1878126
- Child:
- 5:bd5fc0510e7b
File content as of revision 3:45299e7882b9:
#include "mbed.h" #include "stdint.h" #include "project_defines.h" #include "buttons.h" #include "encoder_interface.h" #include "tft_interface.h" #include "stepper_motor_driver.h" #include "ventilator.h" // ****************************** // OBJECT CONSTRUCTION // ****************************** Ticker ticker_int_10us; // Ticker interrupt // ****************************** // GLOBAL VARIABLES // ****************************** // ****************************** // FUNCTION DECLARATION // ****************************** void Ticker_ISR(void); // ISR that is called when the timer reaches the set value int main(void) { Buttons_Initialize(); ticker_int_10us.attach(&Ticker_ISR, 0.01); TFT_Interface_Initialize(); Stepper_Driver_Init(); Stepper_Calculate_Period_Ramp(); while(1){ Stepper_Driver_State_Machine(); TFT_Encoder_Interaction(); } return 0; } // Ticker Interrupt Service Routine void Ticker_ISR(void){ static uint8_t conta_10ms = 0; Button_Debounce(); conta_10ms++; if(conta_10ms == 2){ conta_10ms = 0; Encoder_Read(); } }