rendered paste body#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
void radera(void){
asm{
clr CONFIG2
mov #0x31,CONFIG1
lda #0xff
sta 0xfe09
mov #0b01000000,$88
mov #0x19,$89
ldhx #0xffff
jsr 0xfc06
}
}
void main(void) {
PTAPUE = 0b00001111; //pullup på
DDRB = 0xff; //portb utgång
DDRD = 0b11100000; //3 övre bitarna på portd utgångar
if(!PTA_PTA0 && !PTA_PTA1) {
radera(); //radera om vi tryckt på de båda vänstra knapparna
}
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}