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.
42 lines
1.0 KiB
C++
42 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 WII5Mode.h
|
|
* @brief Base class for run-time operating modes (Capture, Sleep, Position, etc.).
|
|
*/
|
|
|
|
// NOTE: This is a base class for all modes and not really used
|
|
|
|
#ifndef WII5Mode_h
|
|
#define WII5Mode_h
|
|
|
|
#include <Arduino.h>
|
|
#include <TimeLib.h>
|
|
#include <WII5.h>
|
|
#include <elapsedMillis.h>
|
|
|
|
/**
|
|
* @brief Base class for run-time operating modes.
|
|
*
|
|
* Each subclass owns a small state machine that is ticked by
|
|
* WII5Controller::loop() while that mode is active. Concrete modes
|
|
* include WII5ModeCapture, WII5ModeSleep, WII5ModePosition,
|
|
* WII5ModeManualTest, WII5ModeSelfTest, and WII5ModeLowBattery.
|
|
*/
|
|
class WII5Mode {
|
|
public:
|
|
/** @brief One-time bring-up. */
|
|
virtual void begin();
|
|
/** @brief State-machine tick while this mode is active. */
|
|
virtual void loop();
|
|
|
|
protected:
|
|
elapsedMillis wait;
|
|
};
|
|
|
|
#endif
|