servo.h - fixed global variable time_ms
engine.c - fixed pwm setting
eb_ebb_LIBS = can ebb
lib_LIBRARIES = ebb
-ebb_SOURCES = powswitch.c uart.c servo.c engine.c
+ebb_SOURCES = powswitch.c uart.c servo.c engine.c adc.c
-include_HEADERS = engine.h powswitch.h servo.h uart.h
+include_HEADERS = engine.h powswitch.h servo.h uart.h adc.h
else
IO1CLR |= (1<<ENGINE_IN2B);
- engine_A_pwm(pwm_B);
+ engine_B_pwm(pwm_B);
}
void engine_A_pwm(unsigned pwm)
IO0DIR |= (1<<ENGINE_PIN_A);
IO1DIR |= (1<<ENGINE_ENA) | (1<<ENGINE_IN2A);
IO1SET |= (1<<ENGINE_ENA) | (1<<ENGINE_IN2A);
-
PWMPR = 0;
PWMMR0 = CPU_APB_HZ / 20000;
-
-
PWMMR2 =0;
-
PWMPCR |= PWMPCR_PWMENA2_m;
PWMLER |= PWMLER_LA0_m | PWMLER_LA2_m;
/** gobal time
* @note incremented twenty 20ms, overrun every 1194hours
*/
-unsigned int time_ms;
+volatile unsigned int time_ms;
/** Initialize servos
* @note All three servos - should be fixed FIXME