services.c 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #include <stdio.h>
  8. #include "esp_log.h"
  9. #include "driver/gpio.h"
  10. #include "battery.h"
  11. #include "led.h"
  12. #include "monitor.h"
  13. extern void battery_svc_init(void);
  14. extern void monitor_svc_init(void);
  15. extern void led_svc_init(void);
  16. static const char TAG[] = "services";
  17. #ifdef CONFIG_SQUEEZEAMP
  18. #define LED_GREEN_GPIO 12
  19. #define LED_RED_GPIO 13
  20. #endif
  21. /****************************************************************************************
  22. *
  23. */
  24. void services_init(void) {
  25. gpio_install_isr_service(0);
  26. ESP_LOGD(TAG,"Configuring LEDs");
  27. led_svc_init();
  28. #ifdef CONFIG_SQUEEZEAMP
  29. led_config(LED_GREEN, LED_GREEN_GPIO, 0);
  30. led_config(LED_RED, LED_RED_GPIO, 0);
  31. #endif
  32. battery_svc_init();
  33. monitor_svc_init();
  34. }