Skip to content

Commit

Permalink
m32x: revise pwm - review note update
Browse files Browse the repository at this point in the history
  • Loading branch information
TascoDLX committed Feb 2, 2025
1 parent 01426e1 commit e072aa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ares/md/m32x/pwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ auto M32X::PWM::unload(Node::Object parent) -> void {
}

auto M32X::PWM::main() -> void {
int clocks = cycle > 0 ? cycle-1 : 4095;
n12 clocks = cycle - 1;
if(clocks == 0) clocks++;

//check if cycle rate has changed and update sample rate accordingly
Expand Down Expand Up @@ -90,7 +90,7 @@ auto M32X::PWM::power(bool reset) -> void {
}

auto M32X::PWM::updateFrequency() -> void {
int clocks = cycle > 0 ? cycle-1 : 4095;
n12 clocks = cycle - 1;
if(clocks == 0) clocks++;
stream->setFrequency((system.frequency() / 7.0) * 3.0 / clocks);
}

0 comments on commit e072aa5

Please sign in to comment.