Appiko
main.c
1 /*
2  * main.c : Application for SenseBe devices.
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
30 #include <stdbool.h>
31 #include <stdint.h>
32 #include <stddef.h>
33 #include <string.h>
34 
35 #include "evt_sd_handler.h"
36 #include "nrf.h"
37 #include "boards.h"
38 
39 #include "log.h"
40 #include "hal_wdt.h"
41 #include "nrf_util.h"
42 #include "hal_gpio.h"
43 #include "ms_timer.h"
44 #include "hal_nop_delay.h"
45 #include "irq_msg_util.h"
46 #include "device_tick.h"
47 #include "pir_sense.h"
48 #include "hal_pin_analog_input.h"
49 #include "aa_aaa_battery_check.h"
50 #include "button_ui.h"
51 #include "nrf_nvic.h"
52 #include "ble.h"
53 #include "nrf_sdm.h"
54 #include "app_error.h"
55 #include "out_pattern_gen.h"
56 #include "sensebe_ble.h"
57 #include "sensebe_rx_mod.h"
58 #include "sensebe_store_config.h"
59 #include "dev_id_fw_ver.h"
60 #include "led_seq.h"
61 #include "led_ui.h"
62 #include "cam_trigger.h"
63 /* ----- Defines ----- */
64 
67 #define APP_DEVICE_NAME_CHAR 'S','e','n','s','e','B','e'
68 const uint8_t app_device_name[] = { APP_DEVICE_NAME_CHAR };
69 
72 #define APP_UUID_COMPLETE 0x0a, 0xde, 0xfb, 0x07, 0x74, 0x83, 0x66, 0xb0, 0x0d, 0x48, 0xf5, 0x07, 0x60, 0xdc, 0x73, 0x3c
73 
76 #define APP_ADV_DATA { \
77  0x02, BLE_GAP_AD_TYPE_FLAGS, BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE, \
78  sizeof(app_device_name) + 1, BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME, APP_DEVICE_NAME_CHAR, \
79  0x11, BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE, APP_UUID_COMPLETE \
80  }
81 
84 #define APP_SCAN_RSP_DATA { \
85  0x02, BLE_GAP_AD_TYPE_TX_POWER_LEVEL, 0 , \
86  0x11, BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME, \
87  'x', 'x','x', 'x', 'x', 'x' , 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', \
88  0x04, BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA, 0 , 0 , 0 \
89  }
90 
93 #define WDT_PERIOD_MS 301000
94 
96 #define ENABLE_WDT 1
97 
99 #define SENSE_FAST_TICK_INTERVAL_MS 60
100 
101 #define SENSE_SLOW_TICK_INTERVAL_MS 300000
102 
104 #define ADV_FAST_TICK_INTERVAL_MS 60
105 
106 #define ADV_SLOW_TICK_INTERVAL_MS 1100
107 
109 #define CONN_FAST_TICK_INTERVAL_MS 60
110 
111 #define CONN_SLOW_TICK_INTERVAL_MS 1100
112 
114 #define CONN_TIMEOUT_MS (10*60*1000)
115 
117 typedef enum
118 {
122 }sense_states;
123 
124 /* ----- Global constants in flash ----- */
125 
126 /* ----- Global variables in RAM ----- */
129 
131 static uint32_t conn_count;
132 
133 static sensebe_config_t sensebe_ble_default_config = {
134  .tssp_conf.oper_time.day_or_night = 1,
135  .tssp_conf.oper_time.threshold = 0b0000000,
136  .tssp_conf.detect_window = 100,
137  .tssp_conf.intr_trig_timer = 15,
138 
139  .cam_trigs[MOTION_ALL].mode = CAM_TRIGGER_LONG_PRESS,
140  .cam_trigs[MOTION_ALL].larger_value = 30,
141  .cam_trigs[MOTION_ALL].smaller_value = 0,
142  .cam_trigs[MOTION_ALL].pre_focus = 0,
143 
144  .timer_conf.oper_time.day_or_night = 1,
145  .timer_conf.oper_time.threshold = 0b0000000,
146  .timer_conf.timer_interval = 50,
147 
148  .cam_trigs[TIMER_ALL].mode = CAM_TRIGGER_SINGLE_SHOT,
149  .cam_trigs[TIMER_ALL].larger_value = 0,
150  .cam_trigs[TIMER_ALL].smaller_value = 0,
151  .cam_trigs[TIMER_ALL].pre_focus = 0,
152 
153  .trig_conf = MOTION_ONLY,
154 
155  .speed = FAST,
156 };
157 
158 
159 sensebe_tx_rx_config_t default_sensebe_tx_rx_config =
160 {
161 
162  .rx_detect_config.rx_en_pin = TSSP_RX_EN,
163  .rx_detect_config.rx_out_pin = TSSP_RX_OUT,
164  .cam_config.focus_pin_no = JACK_FOCUS_PIN,
165  .cam_config.trigger_pin_no = JACK_TRIGGER_PIN,
166  .light_sense_config.photodiode_pin = PIN_TO_ANALOG_INPUT(PHOTODIODE_LIGHT_SENSE),
167  .light_sense_config.photodiode_en_pin = PHOTODIODE_LIGHT_SENSE_EN,
168 
169  .sensebe_config = &sensebe_ble_default_config,
170 
171 };
172 
173 /* ----- Function declarations ----- */
174 
175 /* ----- Function definitions ----- */
178  log_printf("WDT reset\n");
179 }
180 
181 void prepare_init_ble_adv()
182 {
183  uint8_t app_adv_data[] = APP_ADV_DATA;
184  uint8_t app_scan_rsp_data[] = APP_SCAN_RSP_DATA;
185 
186  //Add in the firmware version
187  memcpy(&app_scan_rsp_data[23], fw_ver_get(), sizeof(fw_ver_t));
188 
189  //Add the device ID
190  memcpy(&app_scan_rsp_data[5], dev_id_get(), sizeof(dev_id_t));
191 
192  sensebe_ble_adv_data_t app_adv_data_struct =
193  {
194  .adv_data = app_adv_data,
195  .scan_rsp_data = app_scan_rsp_data,
196  .adv_len = ARRAY_SIZE(app_adv_data),
197  .scan_rsp_len = ARRAY_SIZE(app_scan_rsp_data)
198  };
199 
200  sensebe_ble_adv_init(&app_adv_data_struct);
201 }
202 
209 static void ble_evt_handler(ble_evt_t * evt)
210 {
211  log_printf("ble evt %x\n", evt->header.evt_id);
212  switch (evt->header.evt_id)
213  {
214  case BLE_GAP_EVT_CONNECTED:
215  irq_msg_push(MSG_STATE_CHANGE, (void *) CONNECTED);
216  break;
217  case BLE_GAP_EVT_DISCONNECTED:
218  irq_msg_push(MSG_STATE_CHANGE, (void *) SENSING);
219  break;
220  case BLE_GAP_EVT_ADV_SET_TERMINATED:
221  irq_msg_push(MSG_STATE_CHANGE, (void *) SENSING);
222  break;
223  case BLE_GAP_EVT_CONN_PARAM_UPDATE:
224  log_printf("sup time %d s, max intvl %d ms, min intvl %d ms, slave lat %d\n",
225  evt->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout/100,
226  (5*evt->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval)/4,
227  (5*evt->evt.gap_evt.params.conn_param_update.conn_params.min_conn_interval)/4,
228  evt->evt.gap_evt.params.conn_param_update.conn_params.slave_latency);
229  break;
230  }
231 }
232 
237 static void get_sensebe_config_t(sensebe_config_t *config)
238 {
240 }
241 
247 void next_interval_handler(uint32_t interval)
248 {
249  log_printf("in %d\n", interval);
250  button_ui_add_tick(interval);
251  switch(current_state)
252  {
253  case SENSING:
254  {
255  log_printf("Nxt Evt Hndlr : SENSING\n");
256  sensebe_tx_rx_add_ticks (interval);
257 
258  }
259  break;
260  case ADVERTISING:
261  break;
262  case CONNECTED:
263  {
264  conn_count += interval;
265  if(conn_count > MS_TIMER_TICKS_MS(CONN_TIMEOUT_MS))
266  {
268  }
269  }
270  break;
271  }
272 }
273 
279 void state_change_handler(uint32_t new_state)
280 {
281  log_printf("State change %d\n", new_state);
282  if(new_state == current_state)
283  {
284  log_printf("new state same as current state\n");
285  return;
286  }
287  current_state = (sense_states) new_state;
288 
289  switch(current_state)
290  {
291  case SENSING:
292  {
293  sd_softdevice_disable();
294  log_printf("State Change : SENSING\n");
295  device_tick_cfg tick_cfg =
296  {
300  };
301  led_ui_type_stop_all(LED_UI_LOOP_SEQ);
302 
303  device_tick_init(&tick_cfg);
305 
306  }
307  break;
308  case ADVERTISING:
309  {
311  conn_count = 0;
312 
313  device_tick_cfg tick_cfg =
314  {
318  };
319  device_tick_init(&tick_cfg);
320 
321 
322  uint8_t is_sd_enabled;
323  sd_softdevice_is_enabled(&is_sd_enabled);
324  // Would be coming from the SENSING mode
325  if(is_sd_enabled == 0)
326  {
330  prepare_init_ble_adv();
331 
332  sensebe_sysinfo sysinfo;
333  memcpy(&sysinfo.id, dev_id_get(), sizeof(dev_id_t));
334  sysinfo.battery_status = aa_aaa_battery_status();
335  memcpy(&sysinfo.fw_ver, fw_ver_get(), sizeof(fw_ver_t));
336  sensebe_ble_update_sysinfo(&sysinfo);
337 
338  sensebe_config_t * config = sensebe_tx_rx_last_config ();
339  sensebe_ble_update_config (config);
340 
342  }
344 
345  led_ui_type_stop_all(LED_UI_LOOP_SEQ);
346  led_ui_loop_start(LED_SEQ_ORANGE_WAVE, LED_UI_MID_PRIORITY);
347  }
348  break;
349  case CONNECTED:
350  {
351  device_tick_cfg tick_cfg =
352  {
356  };
357  device_tick_init(&tick_cfg);
358  led_ui_type_stop_all (LED_UI_LOOP_SEQ);
359  led_ui_loop_start (LED_SEQ_GREEN_WAVE, LED_UI_MID_PRIORITY);
360 
361  break;
362  }
363  }
364 }
365 
373 {
374  log_printf("Act (0 = CROSS, 1= RELEASE) : %d\nStep : %d\n", act,step);
375  if(act == BUTTON_UI_ACT_CROSS)
376  {
377  switch(step)
378  {
379  case BUTTON_UI_STEP_WAKE:
380  log_printf("fast\n");
381  button_ui_config_wake(false);
382  device_tick_cfg tick_cfg =
383  {
387  };
388  device_tick_init(&tick_cfg);
389  break;
391  if(current_state == SENSING)
392  {
393  irq_msg_push(MSG_STATE_CHANGE, (void *) ADVERTISING);
394  }
395 
396  break;
398  break;
399  case BUTTON_UI_STEP_LONG:
400  {
401  NRF_POWER->GPREGRET = 0xB1;
402  log_printf("Trying to do system reset..!!");
403  uint8_t is_sd_enabled;
404  sd_softdevice_is_enabled(&is_sd_enabled);
405  if(is_sd_enabled == 0)
406  {
407  sd_nvic_SystemReset();
408  }
409  else
410  {
411  NVIC_SystemReset ();
412  }
413  }
414  break;
415  }
416  }
417  else //BUTTON_UI_ACT_RELEASE
418  {
420  log_printf("slow\n");
421  button_ui_config_wake(true);
422  switch(step)
423  {
424  case BUTTON_UI_STEP_WAKE:
425  break;
427  break;
429  break;
430  case BUTTON_UI_STEP_LONG:
431  break;
432  }
433  }
434 }
435 
440 void leds_init(void)
441 {
442  hal_gpio_cfg_output(LED_RED, LEDS_ACTIVE_STATE);
443  hal_gpio_cfg_output(LED_GREEN, !LEDS_ACTIVE_STATE);
444  hal_nop_delay_ms(600);
445  hal_gpio_pin_write(LED_RED, !LEDS_ACTIVE_STATE);
446  hal_gpio_pin_write(LED_GREEN, LEDS_ACTIVE_STATE);
447  hal_nop_delay_ms(600);
448  hal_gpio_pin_write(LED_RED, !LEDS_ACTIVE_STATE);
449  hal_gpio_pin_write(LED_GREEN, !LEDS_ACTIVE_STATE);
450 }
451 
457 void boot_pwr_config(void)
458 {
459  log_printf("Reset because of ");
460  if(NRF_POWER->RESETREAS == 0)
461  {
462  log_printf("power on or brownout, ");
463  }
464  if(NRF_POWER->RESETREAS & POWER_RESETREAS_DIF_Msk)
465  {
466  log_printf("entering into debug interface from Sys OFF, ");
467  }
468  if(NRF_POWER->RESETREAS & POWER_RESETREAS_DOG_Msk)
469  {
470  log_printf("watchdog bite, ");
471  }
472  if(NRF_POWER->RESETREAS & POWER_RESETREAS_LOCKUP_Msk)
473  {
474  log_printf("CPU lockup, ");
475  }
476  if(NRF_POWER->RESETREAS & POWER_RESETREAS_OFF_Msk)
477  {
478  log_printf("wake up from SYS OFF by GPIO, ");
479  }
480  if(NRF_POWER->RESETREAS & POWER_RESETREAS_RESETPIN_Msk)
481  {
482  log_printf("pin reset, ");
483  }
484  if(NRF_POWER->RESETREAS & POWER_RESETREAS_SREQ_Msk)
485  {
486  log_printf("software reset, ");
487  }
488  log_printf("\n");
489 
490  //Clear the reset reason
491  NRF_POWER->RESETREAS = (POWER_RESETREAS_DIF_Msk |
492  POWER_RESETREAS_DOG_Msk |
493  POWER_RESETREAS_LOCKUP_Msk |
494  POWER_RESETREAS_OFF_Msk |
495  POWER_RESETREAS_RESETPIN_Msk |
496  POWER_RESETREAS_SREQ_Msk);
497 
498  //Enable the DCDC converter if the board supports it
499 #if DC_DC_CIRCUITRY == true //Defined in the board header file
500  NRF_POWER->DCDCEN = POWER_DCDCEN_DCDCEN_Enabled << POWER_DCDCEN_DCDCEN_Pos;
501 #endif
502  NRF_POWER->TASKS_LOWPWR = 1;
503 }
504 
509 {
511  {
512  sensebe_store_config_write (&sensebe_ble_default_config);
513  }
515 }
516 
520 void slumber(void)
521 {
522  uint8_t is_sd_enabled;
523  sd_softdevice_is_enabled(&is_sd_enabled);
524  // Would in the SENSING mode
525  if(is_sd_enabled == 0)
526  {
527  __WFI();
528  }
529  else
530  {
531  sd_app_evt_wait();
532  }
533 }
534 
538 int main(void)
539 {
540  leds_init();
541 
542  /* Mandatory welcome message */
543  log_init();
544  log_printf("\n\nHello SenseBe World!\n");
545  boot_pwr_config();
546 
548  ms_timer_init(APP_IRQ_PRIORITY_LOW);
549 #if ENABLE_WDT == 1
551  hal_wdt_start();
552 #endif
553 
554  button_ui_init(BUTTON_PIN, APP_IRQ_PRIORITY_LOW,
556 
557  {
558  irq_msg_callbacks cb =
560  irq_msg_init(&cb);
561  }
562 
563  sensebe_tx_rx_init(&default_sensebe_tx_rx_config);
564 
565  current_state = ADVERTISING; //So that a state change happens
566  irq_msg_push(MSG_STATE_CHANGE, (void *)SENSING);
567  sensebe_ble_init(ble_evt_handler, get_sensebe_config_t);
569  load_last_config ();
570 
571  while (true)
572  {
573 #if ENABLE_WDT == 1
574 // Since the application demands that CPU wakes up
575  hal_wdt_feed();
576 #endif
578  irq_msg_process();
579  slumber();
580  }
581 }
582 
void sensebe_ble_update_sysinfo(sensebe_sysinfo *sysinfo)
Updates the characteristic that stores the sysinfo.
Definition: sensebe_ble.c:187
uint8_t aa_aaa_battery_status()
Function to get battery status. It'll convert battery ADC value to 8bit.
sensebe_config_t * sensebe_tx_rx_last_config()
Function to get last config which is being used.
When a button press crosses a particular time.
Definition: button_ui.h:44
fw_ver_t * fw_ver_get(void)
Gets a pointer to the location where the Device ID is stored.
Definition: dev_id_fw_ver.c:35
Lightning mode.
Definition: sensebe_ble.h:61
void boot_pwr_config(void)
Prints the reason for the last reset, enables the internal DC-DC converter if the board supports it a...
Definition: main.c:451
For a short button press.
Definition: button_ui.h:54
void load_last_config()
function to load previous sensepi configuration present in flash memory
Definition: main.c:502
void hal_wdt_start(void)
Definition: hal_wdt.c:71
void sensebe_ble_stack_init(void)
Function for initializing the BLE stack by enabling the SoftDevice and the BLE event interrupt.
Definition: sensebe_ble.c:216
BLE connection established with an app.
Definition: main.c:130
void sensebe_ble_service_init(void)
Create the Service and its characteristics for the SensePi device. There is a read-only characteristi...
Definition: sensebe_ble.c:251
Fast mode.
Definition: device_tick.h:56
void sensebe_ble_init(void(*ble_sd_evt)(ble_evt_t *evt), void(*config_update)(sensebe_config_t *cfg))
Initialize the handlers to pass the BLE SD events and the configuration received from the mobile app.
Definition: sensebe_ble.c:169
button_ui_action
Definition: button_ui.h:42
sense_states current_state
Definition: main.c:137
void sensebe_tx_rx_update_config(sensebe_config_t *update_sensebe_config)
Function to update SenseBe Rx configuration to config received over BLE.
#define CONN_TIMEOUT_MS
Definition: main.c:114
void button_ui_init(uint32_t button_pin, uint32_t irq_priority, void(*button_ui_handler)(button_ui_steps step, button_ui_action act))
Initialize the button ui event generator module.
Definition: button_ui.c:66
For a long button press.
Definition: button_ui.h:55
void led_ui_loop_start(led_sequences seq, led_ui_priority_t priority)
Start a sequence to play repeatedly.
Definition: led_ui.c:247
void sensebe_tx_rx_stop(void)
Function to disable detection for SenseBe Rx.
void sensebe_store_config_write(sensebe_config_t *latest_config)
Function to write the sensebe_config_t at address location received from get_next_location().
#define LEDS_ACTIVE_STATE
Definition: bluey_1v1.h:44
bool sensebe_store_config_is_memory_empty(void)
#define ADV_SLOW_TICK_INTERVAL_MS
Definition: main.c:106
button_ui_steps
Definition: button_ui.h:51
void sensebe_tx_rx_start(void)
Function to enable detection for SenseBe Rx.
void state_change_handler(uint32_t new_state)
The handler that is called whenever the application transitions to a new state.
Definition: main.c:287
void lfclk_init(lfclk_src_t lfclk_src)
Function to initialize the LF clock.
Definition: hal_clocks.c:23
Use PIR sensor to sense motion based on the set configuration.
Definition: main.c:128
void sensebe_ble_disconn(void)
Disconnect the current active connection, if already connected.
Definition: sensebe_ble.c:176
Stucture for passing the configuration for initializing the Device Tick module.
Definition: device_tick.h:64
For a short button press.
Definition: button_ui.h:53
#define APP_ADV_DATA
Definition: main.c:76
void button_handler(button_ui_steps step, button_ui_action act)
Handler for all button related events.
Definition: main.c:378
#define MS_TIMER_TICKS_MS(ms)
Definition: ms_timer.h:64
void sensebe_ble_update_config(sensebe_config_t *config)
Updates the characteristic that stores the SensePi config.
Definition: sensebe_ble.c:201
#define WDT_PERIOD_MS
Definition: main.c:93
void sensebe_ble_adv_start(void)
Function to start advertising.
Definition: sensebe_ble.c:414
#define APP_DEVICE_NAME_CHAR
Definition: main.c:67
void button_ui_config_wake(bool set_wake_on)
To enable/disable the button UI GPIOTE IRQ.
Definition: button_ui.c:128
void wdt_prior_reset_callback(void)
Definition: main.c:180
void device_tick_init(device_tick_cfg *cfg)
Initializes and starts the Device tick module. Provides a next interval event immediately....
Definition: device_tick.c:52
#define CONN_FAST_TICK_INTERVAL_MS
Definition: main.c:109
void ms_timer_init(uint32_t irq_priority)
Definition: ms_timer.c:111
void led_ui_type_stop_all(led_ui_seq_t type)
Stop all sequence of a particular type.
Definition: led_ui.c:275
dev_id_t * dev_id_get(void)
Gets a pointer to the location where the Device ID is stored.
Definition: dev_id_fw_ver.c:30
Same as previous mode.
Definition: device_tick.h:57
sensebe_config_t * sensebe_store_config_get_last_config()
LED_UI_MID_PRIORITY.
Definition: led_ui.h:42
Trigger only on timer.
Definition: sensebe_ble.h:51
void sensebe_ble_gap_params_init(void)
Generic Access Profile initialization. The device name, and the preferred connection parameters are s...
Definition: sensebe_ble.c:346
BLE advertising to get connected to an app.
Definition: main.c:129
#define ARRAY_SIZE(arr)
Definition: common_util.h:70
void sensebe_store_config_check_fw_ver()
Function to check the major number of firmware if latest major number \ firmware version is greater t...
For the moment a button is pressed.
Definition: button_ui.h:56
void device_tick_process(void)
The function to be called whenever the SoC wakes up to see if more than half the time of the current ...
Definition: device_tick.c:89
void irq_msg_init(irq_msg_callbacks *cb_ptr)
Definition: irq_msg_util.c:53
void hal_wdt_feed(void)
Definition: hal_wdt.c:64
#define SENSE_SLOW_TICK_INTERVAL_MS
Definition: main.c:101
void sensebe_tx_rx_add_ticks(uint32_t interval)
Function to handle add tick event.
void slumber(void)
Definition: main.c:180
void leds_init(void)
Initialize and blink the LEDs momentarily. To be used at the start of the program.
Definition: main.c:434
void irq_msg_process(void)
Definition: irq_msg_util.c:77
#define PHOTODIODE_LIGHT_SENSE_EN
Definition: sensebe_rev1.h:64
void device_tick_switch_mode(device_tick_mode mode)
Switches from the fast to slow mode or vice versa.
Definition: device_tick.c:73
int main(void)
Function for application main entry.
Definition: main.c:90
void button_ui_add_tick(uint32_t ui_ticks)
The ticks that need to be sent to the button UI module for its processing.
Definition: button_ui.c:86
sense_states
Definition: main.c:125
void sensebe_ble_adv_init(sensebe_ble_adv_data_t *sensebe_ble_adv_data)
Function to initializing the advertising.
Definition: sensebe_ble.c:369
#define APP_SCAN_RSP_DATA
Definition: main.c:84
void hal_wdt_init(uint32_t period_ms, void(*wdt_timeout_handler)(void))
Definition: hal_wdt.c:34
#define CONN_SLOW_TICK_INTERVAL_MS
Definition: main.c:111
#define SENSE_FAST_TICK_INTERVAL_MS
Definition: main.c:99
void sensebe_tx_rx_init(sensebe_tx_rx_config_t *sensebe_rx_detect_config)
Function to initialize the Rx detect module.
void next_interval_handler(uint32_t interval)
The next interval handler is used for providing a periodic tick to be used by the various modules of ...
Definition: main.c:256
void irq_msg_push(irq_msg_types pushed_msg, void *more_data)
Definition: irq_msg_util.c:64
External crystal.
Definition: hal_clocks.h:38
#define PHOTODIODE_LIGHT_SENSE
Definition: sensebe_rev1.h:61
#define ADV_FAST_TICK_INTERVAL_MS
Definition: main.c:104
Slow mode.
Definition: device_tick.h:55