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

Relay: update setup code, rework masking #2003

Merged
merged 7 commits into from
Nov 22, 2019
Merged

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Nov 21, 2019

  • add u32{to,from}String that use strtoul instead of itoa, add 0b 0o 0x prefix checks
  • update boot mask to use kv storage instead of raw eeprom byte, add migration code
  • update boot mask only after relay status really changes
  • move relay prototypes.h entry into the relay.h, update .ino files to reference it
  • move relay header defaults (RELAY1_PIN etc.) to the relay_config.h
  • refactor c struct into a simple c++ struct, add default and minimal pin+type+reset_pin based on id constructors, thus removing the need to push_back into the array.
  • fix DUMMY_RELAY_COUNT=0, use default constructor via _relays.resize(DUMMY_RELAY_COUNT + _relays.size)

@mcspr
Copy link
Collaborator Author

mcspr commented Nov 21, 2019

wrong issue the first time...

Skipping configuration 'EEPROM_RELAY_STATUS' since the value of 'EEPROM_RELAY_STATUS' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

uint8_t mask = EEPROMr.read(EEPROM_RELAY_STATUS);

Skipping configuration 'EEPROM_RELAY_STATUS' since the value of 'EEPROM_RELAY_STATUS' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

EEPROMr.write(EEPROM_RELAY_STATUS, 0xff);

Codacy / cppcheck false positive. Something about the headers :/

- mask is defined as (relay# status << number)
- transparently handle base-2 and base-10 numbers
- if the relay mode requires us to save the mask, it will be saved as base-2
@mcspr mcspr changed the title Update dummy relay handling Relay: update setup code, rework masking Nov 22, 2019
@mcspr mcspr merged commit 76e2542 into xoseperez:dev Nov 22, 2019
@mcspr mcspr deleted the upd-dummy-relays branch November 22, 2019 22:00
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