Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
/*
* Andy's Workshop NXA66 controller ATMega328p firmware
* Copyright (c) 2017 Andy Brown. http://www.andybrown.me.uk
* Please see website for licensing terms.
*/
#pragma once
namespace nxa66 {
/*
* The power-good input pin is driven low when the power is bad and pulled high
* when it's good
*/
struct PowerGood {
static void setup();
static void onPowerGoodInterrupt();
static void setLedState();
};
/*
* Initialisation
*/
inline void PowerGood::setup() {
GpioPowerGood::setup();
GpioPowerGoodLed::setup();
setLedState();
}
inline void PowerGood::onPowerGoodInterrupt() {
setLedState();
}
inline void PowerGood::setLedState() {
GpioPowerGoodLed::changeTo(GpioPowerGood::read());
}
}