#ifndef __LEDS_SWITCHES__
#define __LEDS_SWITCHES__
+#include <stdint.h>
+
void sm1000_leds_switches_init(void);
void led_pwr(int state);
int switch_back(void);
int ext_ptt(void);
+#define DEBOUNCE_DELAY 500 /*!< Delay to wait while switch bounces */
+
+#define SW_STEADY 0 /*!< Switch is in steady-state */
+#define SW_DEBOUNCE 1 /*!< Switch is being debounced */
+
/*! Switch debounce and logic handling */
struct switch_t {
/*! Debounce/hold timer */
void UsageFault_Handler(void){ ColorfulRingOfDeath(4); }
-static void switch_tick(struct switch_t* const sw)
+void switch_tick(struct switch_t* const sw)
{
if (sw->sw != sw->raw) {
/* State transition, reset timer */
#define FREEDV_NSAMPLES_16K (2*FREEDV_NSAMPLES)
-#define DEBOUNCE_DELAY 500
#define ANNOUNCE_DELAY 300000 /* Supposed to be msec, seems not */
#define MAX_MODES 3
#define DV 1
#define TONE 2
-#define SW_STEADY 0 /*!< Switch is in steady-state */
-#define SW_DEBOUNCE 1 /*!< Switch is being debounced */
-
struct switch_t sw_select; /*!< Switch driver for SELECT button */
struct switch_t sw_back; /*!< Switch driver for BACK button */
struct switch_t sw_ptt; /*!< Switch driver for PTT buttons */