selbsttest funktion hinzugefuegt
This commit is contained in:
parent
f55fd367ee
commit
b7b3fa6327
10 changed files with 193 additions and 77 deletions
39
main.cpp
39
main.cpp
|
@ -2,19 +2,12 @@
|
|||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/wdt.h>
|
||||
#include "mcp23s17.h"
|
||||
#include "tlc5615.h"
|
||||
#include "adu.h"
|
||||
#include "vars.h"
|
||||
#include "selftest.h"
|
||||
|
||||
|
||||
#define LED B0
|
||||
|
||||
|
||||
SPI spi;
|
||||
MCP23S17 beba0(spi, SPIADR::BEBA0);
|
||||
MCP23S17 sw(spi, SPIADR::SWITCH);
|
||||
TLC5615 dac0(spi, SPIADR::AA0);
|
||||
ADU adu;
|
||||
|
||||
ISR(WDT_vect)
|
||||
{
|
||||
while(1)
|
||||
|
@ -27,26 +20,32 @@ ISR(WDT_vect)
|
|||
WDTCSR |= _BV(WDIE);
|
||||
}
|
||||
|
||||
int main()
|
||||
void initAll()
|
||||
{
|
||||
WDTCSR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0);
|
||||
dMode(LED, OUT);
|
||||
dWrite(LED, LOW);
|
||||
wdt_reset();
|
||||
|
||||
sei();
|
||||
|
||||
spi.init();
|
||||
|
||||
beba0.setDirA(0x00); // alle Ausgang
|
||||
beba0.setDirB(0xFF); // alle Eingang
|
||||
beba1.setDirA(0x00); // alle Ausgang
|
||||
beba1.setDirB(0xFF); // alle Eingang
|
||||
sw.setDirB(0xFF); // alle Eingang
|
||||
|
||||
adu.init();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
/*WDTCSR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0);
|
||||
dMode(LED, OUT);
|
||||
dWrite(LED, LOW);
|
||||
wdt_reset();
|
||||
sei();*/
|
||||
|
||||
initAll();
|
||||
|
||||
while(1)
|
||||
{
|
||||
dac0.setValue(adu.getValue(6));
|
||||
wdt_reset();
|
||||
testAll();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue