Pārlūkot izejas kodu

Don't try slow clock for PWM on Teensy LC (not supported by hardware)

teensy4-core
PaulStoffregen pirms 7 gadiem
vecāks
revīzija
83b837a520
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      teensy3/pins_teensy.c

+ 6
- 0
teensy3/pins_teensy.c Parādīt failu

@@ -927,6 +927,11 @@ void analogWriteFrequency(uint8_t pin, float frequency)
ftmClock = 16000000;
} else
#endif
#if defined(__MKL26Z64__)
// Teensy LC does not support slow clock source (ftmClockSource = 2)
ftmClockSource = 1; // Use default F_TIMER clock source
ftmClock = F_TIMER; // Set variable for the actual timer clock frequency
#else
if (frequency < (float)(F_TIMER >> 7) / 65536.0f) {
// frequency is too low for working with F_TIMER:
ftmClockSource = 2; // Use alternative 31250Hz clock source
@@ -935,6 +940,7 @@ void analogWriteFrequency(uint8_t pin, float frequency)
ftmClockSource = 1; // Use default F_TIMER clock source
ftmClock = F_TIMER; // Set variable for the actual timer clock frequency
}
#endif

for (prescale = 0; prescale < 7; prescale++) {

Notiek ielāde…
Atcelt
Saglabāt