Skip to content

Commit

Permalink
Fix PWM resolution for Teensy 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Compizfox committed Feb 15, 2024
1 parent 4766da8 commit 2610cf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ ButtonReader buttonReader(config::PIN_BTN, &voltLadder);
EEPROMConfig eepromConfig;

// PWM frequency and resolution: MCU-dependent
#if defined(ARDUINO_TEENSYLC) || defined(ARDUINO_TEENSY40)
#if defined(ARDUINO_TEENSYLC)
const uint8_t pwmRes = 16;
#elif defined(ARDUINO_TEENSY40)
const uint8_t pwmRes = 15;
#else
const uint8_t pwmRes = 8;
#endif
Expand Down

0 comments on commit 2610cf3

Please sign in to comment.