Skip to content

Commit

Permalink
fix: invert pwm frequency bit, defaults to 125kHz when 0
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-k committed Apr 9, 2024
1 parent 8a5b0ed commit b6dd201
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ impl Configuration {
// wtf is going on here? when I remove the return [...]; there are loads
// of syntax errors
return match self.pwm_frequency {
PwmFrequency::Pwm62_5kHz => 0,
PwmFrequency::Pwm125kHz => BitFlags::DEV_INITIAL_PWM_FREQ,
PwmFrequency::Pwm125kHz => 0,
PwmFrequency::Pwm62_5kHz => BitFlags::DEV_INITIAL_PWM_FREQ,
} | self.data_ref_mode.register_value()
<< BitFlags::DEV_INITIAL_DATA_REF_MODE_SHIFT
| (self.max_line_num & BitFlags::DEV_INITIAL_MAX_LINE_NUM_MASK)
Expand Down Expand Up @@ -111,7 +111,7 @@ impl ConfigBuilder<VariantUnspecified, DataMode16Bit> {
configuration: Configuration {
max_line_num: DV::NUM_LINES,
data_ref_mode: DataRefMode::Mode3,
pwm_frequency: PwmFrequency::Pwm62_5kHz,
pwm_frequency: PwmFrequency::Pwm125kHz,

switch_blanking_time: LineBlankingTime::Blank1us,
pwm_scale_mode: PwmScaleMode::Linear,
Expand Down

0 comments on commit b6dd201

Please sign in to comment.