23 lines
304 B
C++
23 lines
304 B
C++
#include "comperator.h"
|
|
|
|
Comperator::Comperator()
|
|
{
|
|
if constexpr(INTERNAL_REFERANCE) ACSR = 0b01000001;
|
|
else ACSR = 0b00000011;
|
|
}
|
|
|
|
void Comperator::on()
|
|
{
|
|
ACSR &= 0b01111111;
|
|
}
|
|
|
|
void Comperator::off()
|
|
{
|
|
ACSR |= 0b10000000;
|
|
}
|
|
|
|
bool Comperator::compare()
|
|
{
|
|
return ACSR & 0b00100000;
|
|
}
|