basic FS commands

This commit is contained in:
r4
2022-04-19 19:30:15 +02:00
parent 5ed8e8f226
commit 9ecb2f5579
9 changed files with 279 additions and 148 deletions

22
spybug/sys.hh Normal file
View File

@@ -0,0 +1,22 @@
// Copyright 2022 Darwin Schuppan <darwin@nobrain.org>
// SPDX license identifier: MIT
#pragma once
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/sleep.h>
static void (*full_reset)() = nullptr;
void low_power_sleep_minutes(unsigned long t);
static inline void wdt_enable_with_full_reset() {
wdt_enable(WDTO_8S); /* Start watchdog timer for 8s. */
WDTCSR |= (1 << WDIE); /* Enable watchdog interrupt. */
}
static inline void disable_recording_interrupts() {
TIMSK1 &= ~(_BV(OCIE1A) | _BV(OCIE1B));
}