Skip to content

Fix waveform missing edges on cycle rollover #4945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 0 additions & 192 deletions cores/esp8266/core_esp8266_sigma_delta.c.unused

This file was deleted.

10 changes: 2 additions & 8 deletions cores/esp8266/core_esp8266_waveform.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ static inline ICACHE_RAM_ATTR uint32_t min_u32(uint32_t a, uint32_t b) {
return b;
}

static inline ICACHE_RAM_ATTR uint32_t min_s32(int32_t a, int32_t b) {
if (a < b) {
return a;
}
return b;
}

static inline ICACHE_RAM_ATTR void ReloadTimer(uint32_t a) {
// Below a threshold you actually miss the edge IRQ, so ensure enough time
if (a > 32) {
Expand Down Expand Up @@ -251,7 +244,8 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {

// Check for toggles
now = GetCycleCount();
if (now >= wave->nextServiceCycle) {
int32_t cyclesToGo = wave->nextServiceCycle - now;
if (cyclesToGo < 0) {
wave->state = !wave->state;
if (wave->state) {
SetGPIO(wave->gpioMask);
Expand Down