-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
executable file
·48 lines (38 loc) · 972 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "app_error.h"
#include "application_config.h"
#include "lcd_st7735.h"
#include "nordic_common.h"
#include "nrf_delay.h"
#include "nrf_drv_clock.h"
#include "nrf_gpio.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "rtc.h"
#include "saadc.h"
#include "sdk_config.h"
#include <stdlib.h>
static volatile bool m_sampling = false;
static saadc_config_t saadc;
static void lfclk_config(void) {
APP_ERROR_CHECK(nrf_drv_clock_init());
nrf_drv_clock_lfclk_request(NULL);
}
int main(void) {
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();
nrf_gpio_cfg_output(TBASE_SET_PIN);
gfx_init();
background_set();
screen_clear();
lfclk_config();
rtc_config();
NRF_LOG_INFO("Initialized...");
while (1) {
// Make sure any pending events are cleared
__SEV();
__WFE();
// Enter System ON sleep mode
__WFE();
}
}