Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
Loading...
Searching...
No Matches
Particle_Functions.cpp
Go to the documentation of this file.
2#include "Particle.h"
3#include "SensorManager.h"
4#include "MyPersistentData.h" // For sysStatus (serialConnected configuration)
5
6// Prototypes and System Mode calls
7// SYSTEM_THREAD is enabled by default in Device OS 6.2.0+
8SYSTEM_MODE(SEMI_AUTOMATIC); // This will enable user code to start executing
9 // automatically.
10STARTUP(System.enableFeature(FEATURE_RESET_INFO));
11
12#define SERIAL_LOG_LEVEL 3 // Set the logging level for the serial log handler
13// Temporary - will fix with config file later
14
15#if SERIAL_LOG_LEVEL == 0
16SerialLogHandler logHandler(LOG_LEVEL_NONE); // Easier to see the program flow
17#elif SERIAL_LOG_LEVEL == 1
18SerialLogHandler logHandler(LOG_LEVEL_ERROR);
19#elif SERIAL_LOG_LEVEL == 2
20SerialLogHandler logHandler(LOG_LEVEL_WARN);
21#elif SERIAL_LOG_LEVEL == 3
22SerialLogHandler logHandler(LOG_LEVEL_INFO,
23 {// Logging level for non-application messages
24 {"app.pubq", LOG_LEVEL_ERROR},
25 {"app.seqfile", LOG_LEVEL_ERROR},
26 {"comm.dtls", LOG_LEVEL_ERROR},
27 {"comm", LOG_LEVEL_ERROR},
28 {"hal", LOG_LEVEL_ERROR},
29 {"comm.protocol", LOG_LEVEL_ERROR},
30 {"ncp.rltk.client", LOG_LEVEL_ERROR},
31 {"app.device", LOG_LEVEL_ERROR},
32 {"system", LOG_LEVEL_ERROR},
33 {"net.ifapi", LOG_LEVEL_ERROR},
34 {"app.system.reset", LOG_LEVEL_ERROR},
35 {"app.ab1805", LOG_LEVEL_ERROR}});
36#elif SERIAL_LOG_LEVEL == 4
37SerialLogHandler logHandler(LOG_LEVEL_ALL);
38#endif
39
41
42// [static]
49
51
53
55 // Do not block waiting for USB serial; if a host is connected, logs
56 // will be visible. This firmware is designed to run unattended.
57
58 Log.info(
59 "Initializing Particle functions and variables"); // Note: Don't have to
60 // be connected but
61 // these functions need
62 // to in first 30
63 // seconds
64 // Define the Particle variables and functions
65}
66
67// This is the end of the Particle_Functions class
Persistent Data Storage Structures - EEPROM/Retained Memory Management.
SYSTEM_MODE(SEMI_AUTOMATIC)
SerialLogHandler logHandler(LOG_LEVEL_INFO, { {"app.pubq", LOG_LEVEL_ERROR}, {"app.seqfile", LOG_LEVEL_ERROR}, {"comm.dtls", LOG_LEVEL_ERROR}, {"comm", LOG_LEVEL_ERROR}, {"hal", LOG_LEVEL_ERROR}, {"comm.protocol", LOG_LEVEL_ERROR}, {"ncp.rltk.client", LOG_LEVEL_ERROR}, {"app.device", LOG_LEVEL_ERROR}, {"system", LOG_LEVEL_ERROR}, {"net.ifapi", LOG_LEVEL_ERROR}, {"app.system.reset", LOG_LEVEL_ERROR}, {"app.ab1805", LOG_LEVEL_ERROR}})
STARTUP(System.enableFeature(FEATURE_RESET_INFO))
This file initilizes the Particle functions and variables needed for control from the console / API c...
Singleton wrapper around ISensor implementations.
This class is a singleton; you do not create one as a global, on the stack, or with new.
virtual ~Particle_Functions()
The destructor is protected because the class is a singleton and cannot be deleted.
static Particle_Functions * _instance
Singleton instance of this class.
void setup()
Perform setup operations; call this from global application setup().
Particle_Functions()
The constructor is protected because the class is a singleton.
static Particle_Functions & instance()
Gets the singleton instance of this class, allocating it if necessary.