Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
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.

MyIndication.cpp 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #include "MyIndication.h"
  20. #if defined(MY_DEFAULT_TX_LED_PIN)|| defined(MY_DEFAULT_RX_LED_PIN) || defined(MY_DEFAULT_ERR_LED_PIN)
  21. #include "MyLeds.h"
  22. #endif
  23. void setIndication( const indication_t ind )
  24. {
  25. #if defined(MY_DEFAULT_TX_LED_PIN)
  26. if ((INDICATION_TX == ind) || (INDICATION_GW_TX == ind)) {
  27. ledsBlinkTx(1);
  28. } else
  29. #endif
  30. #if defined(MY_DEFAULT_RX_LED_PIN)
  31. if ((INDICATION_RX == ind) || (INDICATION_GW_RX == ind)) {
  32. ledsBlinkRx(1);
  33. } else
  34. #endif
  35. #if defined(MY_DEFAULT_ERR_LED_PIN)
  36. if (ind > INDICATION_ERR_START) {
  37. // Number of blinks indicates which error occurred.
  38. ledsBlinkErr(ind-INDICATION_ERR_START);
  39. }
  40. #endif
  41. indication(ind);
  42. }
  43. #if !defined(MY_INDICATION_HANDLER)
  44. void indication(indication_t)
  45. {
  46. // empty function, resolves AVR-specific GCC optimization bug (<5.5) if handler not used
  47. // see here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326
  48. }
  49. #endif