Skip to content

Commit

Permalink
add check transitions so can change from connecting to operational or…
Browse files Browse the repository at this point in the history
… from IDLE to SENDING_pwm
  • Loading branch information
oganigl committed Feb 7, 2025
1 parent 0c07b3c commit ee3fc53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Core/Inc/Communication/Communication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Communication{
HeapOrder *Disable_Buffer_Order;
HeapOrder *Send_pwm_Order;
HeapOrder *Stop_pwm_Order;

HeapPacket *Pwm_packet;
public:
Communication(Data_struct *data);
static bool received_enable_buffer;
Expand All @@ -23,5 +23,4 @@ class Communication{
static PWM_ACTIVE pwm_received;
void send_UDP_packets();
bool is_connected();
HeapPacket *Pwm_packet;
};
9 changes: 5 additions & 4 deletions Core/Src/StateMachinePCU/StateMachinePCU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,23 @@ void StateMachinePCU::update(){
{
case PWM_ACTIVE::NONE:
three_phased_pwm->turn_off_active_pwm();
return;
break;
case PWM_ACTIVE::U:
three_phased_pwm->set_frequency_u(Communication::frequency_received);
three_phased_pwm->set_duty_u(Communication::duty_cycle_received);
three_phased_pwm->turn_on_u();
return;
break;
case PWM_ACTIVE::V:
three_phased_pwm->set_frequency_v(Communication::frequency_received);
three_phased_pwm->set_duty_v(Communication::duty_cycle_received);
three_phased_pwm->turn_on_v();
return;
break;
case PWM_ACTIVE::W:
three_phased_pwm->set_frequency_w(Communication::frequency_received);
three_phased_pwm->set_duty_w(Communication::duty_cycle_received);
three_phased_pwm->turn_on_w();
return;
break;
}
stateMachine->check_transitions();
}
}

0 comments on commit ee3fc53

Please sign in to comment.