// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2012-2024 Scott Penrose and WII5 Buoy contributors // // This file is part of WII5 Buoy firmware. // See LICENSE for full terms. /** * @file WII5.cpp * @brief Top-level base class and global buffer declarations. */ /* WII5 - Base class for all - not much used here now Main methods: * debugDo ??? * setError(id, string); - includes auto update of time etc */ #include #include /* BUFFERS: The buffers are defined here to allow for central control of space, and potential to reuse them. They should be statically allocated. Need to do more work on shared buffers. Especially for serial ports. */ #ifdef WII5_BUFFER_STRING char wii5BufferString[WII5_BUFFER_STRING]; #endif #ifdef WII5_BUFFER_CONSOLE_BINARY char wii5BufferConsoleBinary[WII5_BUFFER_CONSOLE_BINARY]; #endif #ifdef WII5_BUFFER_CONSOLE_PRINT char wii5BufferConsolePrint[WII5_BUFFER_CONSOLE_PRINT]; #endif #ifdef WII5_BUFFER_CONSOLE_CMD char wii5BufferConsoleCmd[WII5_BUFFER_CONSOLE_CMD]; #endif #ifdef WII5_RADIO_LORA char wii5BufferRadio[WII5_BUFFER_RADIO]; #endif #ifdef WII5_COMMS_IRIDIUM char wii5BufferIridium[WII5_BUFFER_IRIDIUM]; // Used for Serial In / Out char wii5BinaryIridium[WII5_IRIDIUM_BIN_MAX]; // Used to send and receive data to the modem #endif #ifdef WII5_BUFFER_SPARTON char wii5BufferSparton[WII5_BUFFER_SPARTON]; #endif #ifdef WII5_BUFFER_GPS char wii5BufferGPS[WII5_BUFFER_GPS]; #endif #ifdef WII5_RADIO_LORA RH_RF95 wii5RadioRF95(RADIO_CS); #endif void debugDo(uint32_t n) { static uint32_t count = 0; count++; SerialConsole.print(F("DEBUG POINT: ")); SerialConsole.print(n); SerialConsole.print(" "); SerialConsole.println(count); SerialConsole.flush(); } // Simple reusable class to help with multiple boards WII5_DRIVERS WII5::driverId() { return WII5DRIVER_UNKNOWN; } WII5_CONTROLLERS WII5::controllerId() { return WII5CONTROLLER_UNKNOWN; } bool WII5::SJ(DdW when) { if (when >= 1483511955) return true; else return false; }