config.h (2121B)
1 #pragma once 2 3 #include <FlashStorage.h> 4 5 // -*- hardware stuff -*- 6 #define usbSerial SerialUSB // usb serial port 7 #define modemSerial Serial1 // modem serial port 8 #define modemPowerPin SARA_ENABLE // modem power pin 9 #define modemEnablePin SARA_TX_ENABLE // modem enable pin 10 #define modemVoltagePin SARA_R4XX_TOGGLE // modem voltage pin 11 #define batteryPin BAT_VOLT // messuring battery 12 #define chargerPin CHARGER_STATUS // messuring charging 13 #define ledRed LED_RED // rgb-led (red) 14 #define ledGreen LED_GREEN // rgb-led (green) 15 #define ledBlue LED_BLUE // rgb-led (blue) 16 #define trapPin 10 // pin of magnet-sensor 17 18 // -*- behaviour settings -*- 19 #define remoteBaud 115200 // baud-rate of usb-serial 20 #define modemBaud 115200 // baud-rate of modem-serial 21 #define remoteForce true // do not try connect to modem 22 #define lineBuffer 512 // buffer-size (bytes) to use to store lines 23 #define commandDebug true // send debug information about command requests 24 #define eventDebug true // print '+'-events 25 #define lineDebug false // print each line to debug 26 #define blockDebug true // print if command is blocking 27 28 // -*- timing settings (seconds) -*- 29 #define remoteFirstTimeout 5 // seconds to wait for the first timeout 30 #define remoteTimeout 1 // seconds to wait for remote to timeout 31 #define commandTimeout 10 // seconds to cancel a command 32 #define commandDelay 0.1 // delay after every command 33 #define ignoreDelay 2 // seconds to wait if command is run with COMMAND_IGNORE 34 #define gpsTimeout 20 // seconds to gps-timeout 35 #define statusInterval 10 // send status every n seconds 36 #define loopDelay 5 // seconds to wait each loop() 37 38 // -*- battery stuff -*- 39 #define adcAREF 3.3 40 #define batteryR1 4.7 41 #define batteryR2 10.0 42 #define batteryFactor (0.978 * (batteryR1 / batteryR2 + 1) / adcAREF) 43 44 45 struct configuration { 46 bool valid; 47 48 char token[17]; 49 char domain[50]; 50 51 void open(); 52 void save(); 53 }; 54 55 extern FlashStorageClass<configuration> config_flash; 56 57 extern configuration config_default; 58 extern configuration config;