Commit 5abdb87a authored by Clément Foucher's avatar Clément Foucher
Browse files

Adapt HRTIM module to the new board.

parent 2615d168
...@@ -345,50 +345,22 @@ void hrtim_rst_cb_unset(hrtim_t hrtim, hrtim_tu_t tu, hrtim_out_t out, ...@@ -345,50 +345,22 @@ void hrtim_rst_cb_unset(hrtim_t hrtim, hrtim_tu_t tu, hrtim_out_t out,
void hrtim_cmpl_pwm_out(hrtim_t hrtim, hrtim_tu_t tu, bool upper_switch_convention) void hrtim_cmpl_pwm_out(hrtim_t hrtim, hrtim_tu_t tu, bool upper_switch_convention)
{ {
//Configuration for the upper switch convention // Configuration for the upper switch convention
if (upper_switch_convention == true) if (upper_switch_convention == true)
{ {
//Configuration for the TIMA that is not correctly mounted in the hardware dev(hrtim)->sTimerxRegs[tu].SETx1R = PER;
//It is actually inversed that is why TIMA has a different configuration dev(hrtim)->sTimerxRegs[tu].RSTx1R = CMP1;
//To be changed for the new booard dev(hrtim)->sTimerxRegs[tu].SETx2R = CMP1;
if(tu==0) dev(hrtim)->sTimerxRegs[tu].RSTx2R = PER;
{
dev(hrtim)->sTimerxRegs[tu].SETx1R = CMP1;
dev(hrtim)->sTimerxRegs[tu].RSTx1R = PER;
dev(hrtim)->sTimerxRegs[tu].SETx2R = PER;
dev(hrtim)->sTimerxRegs[tu].RSTx2R = CMP1;
}
else
{
dev(hrtim)->sTimerxRegs[tu].SETx1R = PER;
dev(hrtim)->sTimerxRegs[tu].RSTx1R = CMP1;
dev(hrtim)->sTimerxRegs[tu].SETx2R = CMP1;
dev(hrtim)->sTimerxRegs[tu].RSTx2R = PER;
}
} }
//Configuration for the lower switch convention // Configuration for the lower switch convention
else if (upper_switch_convention == false) else if (upper_switch_convention == false)
{ {
//Configuration for the TIMA that is not correctly mounted in the hardware dev(hrtim)->sTimerxRegs[tu].SETx1R = CMP1;
//It is actually inversed that is why TIMA has a different configuration dev(hrtim)->sTimerxRegs[tu].RSTx1R = PER;
//To be changed for the new booard dev(hrtim)->sTimerxRegs[tu].SETx2R = PER;
if(tu==0) dev(hrtim)->sTimerxRegs[tu].RSTx2R = CMP1;
{
dev(hrtim)->sTimerxRegs[tu].SETx1R = PER;
dev(hrtim)->sTimerxRegs[tu].RSTx1R = CMP1;
dev(hrtim)->sTimerxRegs[tu].SETx2R = CMP1;
dev(hrtim)->sTimerxRegs[tu].RSTx2R = PER;
}
else
{
dev(hrtim)->sTimerxRegs[tu].SETx1R = CMP1;
dev(hrtim)->sTimerxRegs[tu].RSTx1R = PER;
dev(hrtim)->sTimerxRegs[tu].SETx2R = PER;
dev(hrtim)->sTimerxRegs[tu].RSTx2R = CMP1;
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment