Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
globals.h File Reference
#include "SparkFun_u-blox_SARA-R5_Arduino_Library.h"
#include "CAT_M1.h"
#include <str_utils.h>
Include dependency graph for globals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EXTERN   extern
 
#define IO_TO_ARDUINO(p)   (0x80 + (p))
 
#define ARDUINO_TO_IO(p)   ((p) & 0x7F)
 Convert an Arduino pin number usable with digitalWrite (0x81, 0x82, ...) to an IO expander pin number (1, 2, ...) More...
 
#define SD_CARD_ENABLE   0x85
 
#define MAX_NUMERIC_STR_SZ   32
 The size for a buffer to hold the string representation of an integer or float. More...
 
#define MAX_G_BUFFER   65536
 The maximum safe size for g_buffer. More...
 

Functions

void shutdown (void)
 

Variables

const char * commit_id
 
const char * repo_status
 
const char * repo_branch
 
uint16_t ver_major
 
uint16_t ver_minor
 
uint16_t ver_update
 
bool spiffs_ok
 
EXTERN char g_buffer [MAX_G_BUFFER+1]
 
EXTERN bool r5_ok
 
constexpr char sd_card_datafile_name [] = "/data.json"
 
constexpr char sd_card_logfile_name [] = "/log.txt"
 
constexpr char send_fw_version_name [] = "/send_fw_version"
 
constexpr char ftp_file_upload_dir [] = "/uploads"
 
constexpr const char sdi12defn_spiffs [] = "/sdi12defn.json"
 
constexpr const char * sdi12defn_no_slash = &sdi12defn_spiffs[1]
 
EXTERN volatile bool timeout_active
 
EXTERN volatile bool timeout_restart
 
SARA_R5 r5
 
char * script
 

Macro Definition Documentation

◆ ARDUINO_TO_IO

#define ARDUINO_TO_IO (   p)    ((p) & 0x7F)

Convert an Arduino pin number usable with digitalWrite (0x81, 0x82, ...) to an IO expander pin number (1, 2, ...)

◆ EXTERN

#define EXTERN   extern

◆ IO_TO_ARDUINO

#define IO_TO_ARDUINO (   p)    (0x80 + (p))

Convert an IO expander pin number (1, 2, ...) to an pin number usable with digitalWrite (0x81, 0x82, ...) Note that digitalWrite has been redefined to understand that pin numbers >= 0x80 should be toggled on the IO expander IC, not the ESP32.

◆ MAX_G_BUFFER

#define MAX_G_BUFFER   65536

The maximum safe size for g_buffer.

◆ MAX_NUMERIC_STR_SZ

#define MAX_NUMERIC_STR_SZ   32

The size for a buffer to hold the string representation of an integer or float.

◆ SD_CARD_ENABLE

#define SD_CARD_ENABLE   0x85

Set HIGH to enable the SD card, LOW to disable the card. This pin drives a transistor that connects or disconnects the SD card GND pin.

Function Documentation

◆ shutdown()

void shutdown ( void  )

Variable Documentation

◆ commit_id

const char* commit_id
extern

◆ ftp_file_upload_dir

constexpr char ftp_file_upload_dir[] = "/uploads"
constexpr

◆ g_buffer

EXTERN char g_buffer[MAX_G_BUFFER+1]

A buffer for use anywhere in the main task, it is MAX_G_BUFFER+1 bytes long. Use MAX_G_BUFFER as the length when writing strings to g_buffer, but use sizeof(g_buffer) in memset to guarantee a terminating null.

Do not use in other tasks.

◆ r5

SARA_R5 r5
extern

◆ r5_ok

EXTERN bool r5_ok

◆ repo_branch

const char* repo_branch
extern

◆ repo_status

const char* repo_status
extern

◆ script

char* script
extern

◆ sd_card_datafile_name

constexpr char sd_card_datafile_name[] = "/data.json"
constexpr

◆ sd_card_logfile_name

constexpr char sd_card_logfile_name[] = "/log.txt"
constexpr

◆ sdi12defn_no_slash

constexpr const char* sdi12defn_no_slash = &sdi12defn_spiffs[1]
constexpr

◆ sdi12defn_spiffs

constexpr const char sdi12defn_spiffs[] = "/sdi12defn.json"
constexpr

Default configuration filename on SPIFFS. SPIFFS requires the leading / but nothing else does.

◆ send_fw_version_name

constexpr char send_fw_version_name[] = "/send_fw_version"
constexpr

◆ spiffs_ok

bool spiffs_ok
extern

◆ timeout_active

EXTERN volatile bool timeout_active

A flag to specify whether the timeout task should ignore timeout_restart. Can be set by the app code, but probably shouldn't be. The config eto and config dto commands change this.

◆ timeout_restart

EXTERN volatile bool timeout_restart

Used to decide whether to reboot. If this is true after the timeout task wakes up it means the app code did not set it to false so is stuck somewhere.

Note the app never sets this to false because there is nothing the app does that should take longer than about 10 minutes. The app should usually take less than 1 minute, but an OTA firmware update can take a long time to download the image.

◆ ver_major

uint16_t ver_major
extern

◆ ver_minor

uint16_t ver_minor
extern

◆ ver_update

uint16_t ver_update
extern