git.droids-corp.org
/
aversive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
indent
[aversive.git]
/
projects
/
microb2010
/
ballboard
/
main.c
diff --git
a/projects/microb2010/ballboard/main.c
b/projects/microb2010/ballboard/main.c
index
ed8716b
..
925109f
100755
(executable)
--- a/
projects/microb2010/ballboard/main.c
+++ b/
projects/microb2010/ballboard/main.c
@@
-58,6
+58,7
@@
#include "actuator.h"
#include "cs.h"
#include "i2c_protocol.h"
#include "actuator.h"
#include "cs.h"
#include "i2c_protocol.h"
+#include "state.h"
/* 0 means "programmed"
* ---- with 16 Mhz quartz
/* 0 means "programmed"
* ---- with 16 Mhz quartz
@@
-169,13
+170,17
@@
int main(void)
# error not supported
#endif
# error not supported
#endif
- //eeprom_write_byte(EEPROM_MAGIC_ADDRESS, EEPROM_MAGIC_BALLBOARD);
/* check eeprom to avoid to run the bad program */
if (eeprom_read_byte(EEPROM_MAGIC_ADDRESS) !=
EEPROM_MAGIC_BALLBOARD) {
/* check eeprom to avoid to run the bad program */
if (eeprom_read_byte(EEPROM_MAGIC_ADDRESS) !=
EEPROM_MAGIC_BALLBOARD) {
+ int c;
sei();
sei();
- printf_P(PSTR("Bad eeprom value\r\n"));
- while(1);
+ printf_P(PSTR("Bad eeprom value ('f' to force)\r\n"));
+ c = uart_recv(CMDLINE_UART);
+ if (c == 'f')
+ eeprom_write_byte(EEPROM_MAGIC_ADDRESS, EEPROM_MAGIC_BALLBOARD);
+ wait_ms(100);
+ bootloader();
}
/* LOGS */
}
/* LOGS */
@@
-252,6
+257,8
@@
int main(void)
printf_P(PSTR("\r\n"));
printf_P(PSTR("Dass das Gluck deinen Haus setzt.\r\n"));
printf_P(PSTR("\r\n"));
printf_P(PSTR("Dass das Gluck deinen Haus setzt.\r\n"));
+
+ state_machine();
cmdline_interact();
return 0;
cmdline_interact();
return 0;