got some comms working, still stops working when motor runs

This commit is contained in:
Nicolas Trimborn
2021-08-19 13:45:50 +02:00
parent 412654754c
commit 5d712c8003
8 changed files with 935 additions and 25 deletions

View File

@@ -158,7 +158,7 @@ void APPLICATION_StateMachine(void)
case MOTORS_ON:
applicationStatus.previousstate = applicationStatus.currentstate;
//applicationStatus.currentstate ;
comms_check();
//comms_check();
motor_StateMachine(&Motor1);
motor_StateMachine(&Motor2);
break;
@@ -213,15 +213,18 @@ int main(void)
while (1) {
//if (Motor1.timerflags.adc_readings_ready_tic) {process_currents();}
if (Motor1.timerflags.current_loop_tic) {
APPLICATION_StateMachine();
exec_commutation(&Motor1);
exec_commutation(&Motor2);
//APPLICATION_StateMachine();
//exec_commutation(&Motor1);
//exec_commutation(&Motor2);
}
if (Motor1.timerflags.motor_telemetry_flag) {
Motor1.timerflags.motor_telemetry_flag = false;
update_telemetry();
update_setpoints();
APPLICATION_StateMachine();
exec_commutation(&Motor1);
exec_commutation(&Motor2);
}
//if (run_ECAT) {ECAT_STATE_MACHINE();}