Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
753 B

  1. /*
  2. LIGHT MODULE
  3. */
  4. #pragma once
  5. constexpr const unsigned char _lightEnablePin() {
  6. return LIGHT_ENABLE_PIN;
  7. }
  8. constexpr const unsigned char _lightChannelPin(unsigned char index) {
  9. return (
  10. (index == 0) ? LIGHT_CH1_PIN :
  11. (index == 1) ? LIGHT_CH2_PIN :
  12. (index == 2) ? LIGHT_CH3_PIN :
  13. (index == 3) ? LIGHT_CH4_PIN :
  14. (index == 4) ? LIGHT_CH5_PIN : GPIO_NONE
  15. );
  16. }
  17. constexpr const bool _lightInverse(unsigned char index) {
  18. return (
  19. (index == 0) ? (1 == LIGHT_CH1_INVERSE) :
  20. (index == 1) ? (1 == LIGHT_CH2_INVERSE) :
  21. (index == 2) ? (1 == LIGHT_CH3_INVERSE) :
  22. (index == 3) ? (1 == LIGHT_CH4_INVERSE) :
  23. (index == 4) ? (1 == LIGHT_CH5_INVERSE) : false
  24. );
  25. }