eBoard
①⑧⑨
Written for SIA 2017/2018
Main Page
Pages
Tutorials
Namespaces
Classes
Files
File List
File Members
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
);
26
_OpwmValue
=
_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;
43
trig_rept_task
();
44
timer_ofl =
false
;
45
}
46
TCNT2 = 256 - (int)((
float
)F_CPU * 0.001 / 64);
47
}
48
50
#endif
PIN_MOTOR_SPE
#define PIN_MOTOR_SPE
Definition:
eBoard.h:576
rept_task
void rept_task(void)
trig_rept_task
void trig_rept_task(void)
this is the method that will call rept_task
EBOARD_PWM_SPE
#define EBOARD_PWM_SPE
Definition:
eBoard.h:434
_pwmValue
optVAL_t _pwmValue
Definition:
eagle_PinCtrl.h:21
_OpwmValue
optVAL_t _OpwmValue
Definition:
eagle_PinCtrl.h:21
eBoard
source
eagle_ReptTask.h
[WIP-510]
EagleoutIce
22.06.2018 00:28:45