Skip to content
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

Static configuration for LED & Buttons #2117

Merged
merged 4 commits into from Jan 21, 2020
Merged

Static configuration for LED & Buttons #2117

merged 4 commits into from Jan 21, 2020

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Jan 21, 2020

  • use similar to relay & wifi, configuration through helper methods that use indexed defines
  • clock cycles for led delay polling. less cpu time than millis, since we only ever use small delays.
    I wonder if polling is even necessary though and this can be system timer (through Ticker) with periodic re-scheduling of either ON or OFF digitalWrite callback.
  • button mode defaults in the header. add RELAY_NONE, similar use-case as GPIO_NONE, removing - 1 for each relayID operation.
  • cleanup some size() checks

This also changed Dual and Foxel initialization of buttons, since wiki states

The Sonoff Dual it's a bit tricky to flash since GPIO0 is not connected to the button

No reason to use real GPIO.

Small patch for #2116 to use a different style of enum.
Fix espurna-base build by having TimeLib.h in utils (since we do use it)

- use similar to relay & wifi, configuration through helper methods that
  use indexed defines
- clock cycles for led delay polling
- button mode defaults
@mcspr mcspr merged commit cbd7064 into xoseperez:dev Jan 21, 2020
@mcspr mcspr deleted the patch-1 branch January 21, 2020 23:21
@mcspr mcspr added this to the 1.14.2 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant