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
avant la coupe de belgique
[aversive.git]
/
projects
/
microb2010
/
mainboard
/
main.c
diff --git
a/projects/microb2010/mainboard/main.c
b/projects/microb2010/mainboard/main.c
index
4061d19
..
633a35d
100755
(executable)
--- a/
projects/microb2010/mainboard/main.c
+++ b/
projects/microb2010/mainboard/main.c
@@
-83,8
+83,8
@@
struct genboard gen;
struct mainboard mainboard;
struct genboard gen;
struct mainboard mainboard;
-struct cobboard cobboard;
-struct ballboard ballboard;
+
volatile
struct cobboard cobboard;
+
volatile
struct ballboard ballboard;
#ifndef HOST_VERSION
/***********************/
#ifndef HOST_VERSION
/***********************/
@@
-133,9
+133,21
@@
void do_time_monitor(void *dummy)
void do_led_blink(void *dummy)
{
void do_led_blink(void *dummy)
{
-#if 1 /* simple blink */
- LED1_TOGGLE();
-#endif
+ static uint8_t a = 0;
+
+ if (mainboard.flags & DO_ERRBLOCKING) {
+ if (a & 1)
+ LED1_ON();
+ else
+ LED1_OFF();
+ }
+ else {
+ if (a & 4)
+ LED1_ON();
+ else
+ LED1_OFF();
+ }
+ a++;
}
static void main_timer_interrupt(void)
}
static void main_timer_interrupt(void)
@@
-171,7
+183,7
@@
int main(void)
memset(&gen, 0, sizeof(gen));
memset(&mainboard, 0, sizeof(mainboard));
mainboard.flags = DO_ENCODERS | DO_CS | DO_RS |
memset(&gen, 0, sizeof(gen));
memset(&mainboard, 0, sizeof(mainboard));
mainboard.flags = DO_ENCODERS | DO_CS | DO_RS |
- DO_POS | DO_POWER | DO_BD;
+ DO_POS | DO_POWER | DO_BD
| DO_ERRBLOCKING
;
/* UART */
uart_init();
/* UART */
uart_init();
@@
-262,13
+274,13
@@
int main(void)
/* all cs management */
microb_cs_init();
/* all cs management */
microb_cs_init();
+ /* TIME */
+ time_init(TIME_PRIO);
+
#ifndef HOST_VERSION
/* sensors, will also init hardware adc */
sensor_init();
#ifndef HOST_VERSION
/* sensors, will also init hardware adc */
sensor_init();
- /* TIME */
- time_init(TIME_PRIO);
-
/* start i2c slave polling */
scheduler_add_periodical_event_priority(i2c_poll_slaves, NULL,
8000L / SCHEDULER_UNIT, I2C_POLL_PRIO);
/* start i2c slave polling */
scheduler_add_periodical_event_priority(i2c_poll_slaves, NULL,
8000L / SCHEDULER_UNIT, I2C_POLL_PRIO);
@@
-281,7
+293,7
@@
int main(void)
/* strat-related event */
scheduler_add_periodical_event_priority(strat_event, NULL,
/* strat-related event */
scheduler_add_periodical_event_priority(strat_event, NULL,
-
25
000L / SCHEDULER_UNIT,
+
10
000L / SCHEDULER_UNIT,
STRAT_PRIO);
#ifndef HOST_VERSION
STRAT_PRIO);
#ifndef HOST_VERSION
@@
-304,7
+316,7
@@
int main(void)
#endif
#ifdef HOST_VERSION
#endif
#ifdef HOST_VERSION
- strat_reset_pos(
1000, 1000, -90
);
+ strat_reset_pos(
400, COLOR_Y(400), COLOR_A(-90)
);
#endif
cmdline_interact();
#endif
cmdline_interact();