-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
59 lines (51 loc) · 1.43 KB
/
main.h
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
49
50
51
52
53
54
55
56
57
58
59
/**
* @file main.h
* @author Bernd Giesecke (bernd@giesecke.tk)
* @brief Globals and Includes
* @version 0.1
* @date 2022-04-10
*
* @copyright Copyright (c) 2022
*
*/
#include <Arduino.h>
#include "wisblock_cayenne.h"
// Debug
// Debug output set to 0 to disable app debug output
#ifndef MY_DEBUG
#define MY_DEBUG 0
#endif
#if MY_DEBUG > 0
#define MYLOG(tag, ...) \
do \
{ \
if (tag) \
Serial.printf("[%s] ", tag); \
Serial.printf(__VA_ARGS__); \
Serial.printf("\n"); \
} while (0); \
delay(100)
#else
#define MYLOG(...)
#endif
// Forward declarations
void send_packet(void);
/** Send Interval offset in flash */
#define SEND_FREQ_OFFSET 0x00000002 // length 4 bytes
// Cayenne LPP Channel numbers per sensor value
#define LPP_CHANNEL_BATT 1 // Base Board
// Globals
uint8_t get_min_dr(uint16_t region, uint16_t payload_size);
extern uint32_t g_send_repeat_time;
extern volatile bool tx_active;
extern WisCayenne g_solution_data;
// RAK13011 Functions
bool init_rak13011(void);
void handle_rak13011(void *);
#define LPP_CHANNEL_SWITCH 48 // RAK13011
extern volatile int switch_status;
// Custom AT commands
bool init_status_at(void);
bool init_interval_at(void);
bool get_at_setting(void);
bool save_at_setting(void);