timer not worke
This commit is contained in:
parent
022ccb13a0
commit
f2019dd57a
@ -74,16 +74,24 @@ void init_ac0(){
|
||||
}
|
||||
|
||||
void test(){
|
||||
printf("yo");
|
||||
printf("yo %u", falling_edge_counter);
|
||||
}
|
||||
|
||||
ISR(AC0_AC_vect){ // AC0 vec flag
|
||||
cli();
|
||||
AC0.STATUS |= 0x10; //CMP flag to 0.
|
||||
falling_edge_counter++;
|
||||
//printf("yo");
|
||||
test();
|
||||
sei();
|
||||
}
|
||||
|
||||
ISR (TCA0_OVF_vect) {
|
||||
cli();
|
||||
RPM_calculation(falling_edge_counter,1E-3);
|
||||
TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm ;
|
||||
sei();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -36,6 +36,7 @@ int main(void) {
|
||||
init_uart((uint16_t)9600);
|
||||
stdout = &USART_stream;
|
||||
init_TCA0();
|
||||
TCA0_update_period_ms();
|
||||
init_ac0();
|
||||
sei();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user