I posted this in Questions, but the Bugs & Suggestions forum is probably a better place.
The Ticker and Timeout functionalities don't seem to be working properly for small times (<70ms or so) on the KL25Z.
The ticker looks like it's either triggering multiple times per tick or skipping ticks.
Ticker example
#include "mbed.h"
DigitalOut out(PTA1);
Ticker tick;
void togglePin (void) {
out = !out;
}
int main() {
tick.attach_us(togglePin, 10000);
}

The timeout looks like it triggers in no faster than 65ms.
Timeout example
#include "mbed.h"
DigitalOut out(PTA1);
Timeout timer;
void toggleOff (void);
void toggleOn (void) {
out = 1;
timer.attach_us(toggleOff, 10000);
}
void toggleOff(void) {
out = 0;
timer.attach_us(toggleOn, 30000);
}
int main() {
toggleOn();
}
It may be coincidence, but the cutoff seems to be close to 65535us, the maximum size of a 16-bit unsigned integer.
I posted this in Questions, but the Bugs & Suggestions forum is probably a better place.
The Ticker and Timeout functionalities don't seem to be working properly for small times (<70ms or so) on the KL25Z.
The ticker looks like it's either triggering multiple times per tick or skipping ticks.
Ticker example
#include "mbed.h" DigitalOut out(PTA1); Ticker tick; void togglePin (void) { out = !out; } int main() { tick.attach_us(togglePin, 10000); }The timeout looks like it triggers in no faster than 65ms.
Timeout example
#include "mbed.h" DigitalOut out(PTA1); Timeout timer; void toggleOff (void); void toggleOn (void) { out = 1; timer.attach_us(toggleOff, 10000); } void toggleOff(void) { out = 0; timer.attach_us(toggleOn, 30000); } int main() { toggleOn(); }It may be coincidence, but the cutoff seems to be close to 65535us, the maximum size of a 16-bit unsigned integer.