eBoard ①⑧⑨
Written for SIA 2017/2018
eagle_ReptTask.h
Go to the documentation of this file.
1 #ifndef EAGLE_EBOARD_HELPLIB_REPTTASK
2 #define EAGLE_EBOARD_HELPLIB_REPTTASK
3 
4 
13 //=====================================================================================================================================================
14 // Rept Task
15 //=====================================================================================================================================================
16 
18 void trig_rept_task(void);
19 
21  void trig_rept_task() {
22 
23  #if EBOARD_NANO == 0x0 || defined(DOC)
24  if (_pwmValue!=_OpwmValue){
25  analogWrite(PIN_MOTOR_SPE,_pwmValue);
27  }
28  #endif
29 
30  #ifdef REPT_TASK
31  rept_task();
32  #endif
33  }
34 
35  int timer_count = 0;
36  bool timer_ofl = false;
37 
38  ISR(TIMER2_OVF_vect) {
39  timer_count++;
40  if(timer_count >= EBOARD_PWM_SPE*1000 && !timer_ofl){
41  timer_ofl = true;
42  timer_count -= EBOARD_PWM_SPE*1000;
44  timer_ofl = false;
45  }
46  TCNT2 = 256 - (int)((float)F_CPU * 0.001 / 64);
47  }
48 
50 #endif
#define PIN_MOTOR_SPE
Definition: eBoard.h:576
void rept_task(void)
void trig_rept_task(void)
this is the method that will call rept_task
#define EBOARD_PWM_SPE
Definition: eBoard.h:434
optVAL_t _pwmValue
Definition: eagle_PinCtrl.h:21
optVAL_t _OpwmValue
Definition: eagle_PinCtrl.h:21