295abb37ee
Firmware for an autonomous wave-measurement buoy (ATmega2560-based WII5 v2 board). Reads wave motion from a Sparton AHRS-M1/M2 IMU, samples GPS and battery state, and reports back over Iridium SBD satellite telemetry. Originally developed 2012-2024. This is the first public release. Code, documentation, and field-tested operating modes (Capture, Sleep, Position, ManualTest, SelfTest, LowBattery) are licensed under Apache 2.0 — see LICENSE and NOTICE. See README.md for an overview and build instructions, CONTRIBUTING.md for how to contribute, and DEPLOYMENTS.md for the field-deployment log.
45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright (c) 2012-2024 Scott Penrose <scottp@dd.com.au> and WII5 Buoy contributors
|
|
//
|
|
// This file is part of WII5 Buoy firmware.
|
|
// See LICENSE for full terms.
|
|
|
|
/**
|
|
* @file WII5Sh3dUtil.h
|
|
* @brief Sh3d utility helpers: sleep, reset, and platform glue.
|
|
*/
|
|
|
|
#ifndef WII5Sh3dUtil_h
|
|
#define WII5Sh3dUtil_h
|
|
|
|
#include <Arduino.h> //assumes Arduino IDE v1.0 or greater
|
|
|
|
#include <TimeLib.h>
|
|
#include <WII5Data.h>
|
|
#include <WII5Sh3dIO.h> // Codependence GAH ! TODO
|
|
#include <WII5Sh3dConsole.h>
|
|
#include <elapsedMillis.h>
|
|
|
|
class WII5Sh3dUtil {
|
|
public:
|
|
|
|
void begin();
|
|
void loop();
|
|
|
|
// Reset - and other low level hacks
|
|
void reset();
|
|
|
|
// Sleep Stuff
|
|
uint8_t sleep(uint32_t seconds);
|
|
uint32_t sleepLastSeconds; // How long did we last sleep for - replaced after sleep
|
|
uint8_t sleepLastReason; // Why did we leave sleep (button, time up etc)
|
|
time_t sleepLastTime; // When did the sleep occur
|
|
|
|
protected:
|
|
|
|
};
|
|
|
|
extern WII5Sh3dUtil sh3dNodeUtil;
|
|
|
|
#endif
|