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
vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git]
/
projects
/
microb2010
/
ballboard
/
main.h
diff --git
a/projects/microb2010/ballboard/main.h
b/projects/microb2010/ballboard/main.h
index
3ebb1e7
..
adfa627
100755
(executable)
--- a/
projects/microb2010/ballboard/main.h
+++ b/
projects/microb2010/ballboard/main.h
@@
-19,6
+19,8
@@
*
*/
*
*/
+/* was mainboard in 2009 */
+
#define LED_TOGGLE(port, bit) do { \
if (port & _BV(bit)) \
port &= ~_BV(bit); \
#define LED_TOGGLE(port, bit) do { \
if (port & _BV(bit)) \
port &= ~_BV(bit); \
@@
-30,13
+32,13
@@
#define LED1_OFF() cbi(PORTJ, 2)
#define LED1_TOGGLE() LED_TOGGLE(PORTJ, 2)
#define LED1_OFF() cbi(PORTJ, 2)
#define LED1_TOGGLE() LED_TOGGLE(PORTJ, 2)
-#define LED2_ON() sbi(PORT
L, 7
)
-#define LED2_OFF() cbi(PORT
L, 7
)
-#define LED2_TOGGLE() LED_TOGGLE(PORT
L, 7
)
+#define LED2_ON() sbi(PORT
J, 3
)
+#define LED2_OFF() cbi(PORT
J, 3
)
+#define LED2_TOGGLE() LED_TOGGLE(PORT
J, 3
)
-#define LED3_ON() sbi(PORT
J, 3
)
-#define LED3_OFF() cbi(PORT
J, 3
)
-#define LED3_TOGGLE() LED_TOGGLE(PORT
J, 3
)
+#define LED3_ON() sbi(PORT
L, 7
)
+#define LED3_OFF() cbi(PORT
L, 7
)
+#define LED3_TOGGLE() LED_TOGGLE(PORT
L, 7
)
#define LED4_ON() sbi(PORTL, 6)
#define LED4_OFF() cbi(PORTL, 6)
#define LED4_ON() sbi(PORTL, 6)
#define LED4_OFF() cbi(PORTL, 6)
@@
-49,25
+51,26
@@
#define ROLLER_ENCODER ((void *)0)
#define FORKTRANS_ENCODER ((void *)1)
#define FORKROT_ENCODER ((void *)2)
#define ROLLER_ENCODER ((void *)0)
#define FORKTRANS_ENCODER ((void *)1)
#define FORKROT_ENCODER ((void *)2)
+#define BEACON_ENCODER ((void *)3)
#define ROLLER_PWM ((void *)&gen.pwm1_4A)
#define FORKTRANS_PWM ((void *)&gen.pwm2_4B)
#define FORKROT_PWM ((void *)&gen.pwm3_1A)
#define ROLLER_PWM ((void *)&gen.pwm1_4A)
#define FORKTRANS_PWM ((void *)&gen.pwm2_4B)
#define FORKROT_PWM ((void *)&gen.pwm3_1A)
-#define
XXX_PWM
((void *)&gen.pwm4_1B)
+#define
BEACON_PWM
((void *)&gen.pwm4_1B)
-#define B
ALL_PRESENT_SENSOR 2 /* XXX dummy example */
+#define B
EACON_POS_SENSOR 2
/** ERROR NUMS */
#define E_USER_I2C_PROTO 195
#define E_USER_SENSOR 196
/** ERROR NUMS */
#define E_USER_I2C_PROTO 195
#define E_USER_SENSOR 196
-#define E_USER_BEACON 197
-#define E_USER_SCANNER 198
-#define E_USER_IMGPROCESS 199
+#define E_USER_ST_MACH 197
+#define E_USER_BEACON 198
#define LED_PRIO 170
#define TIME_PRIO 160
#define ADC_PRIO 120
#define CS_PRIO 100
#define LED_PRIO 170
#define TIME_PRIO 160
#define ADC_PRIO 120
#define CS_PRIO 100
+#define BEACON_PRIO 80
#define I2C_POLL_PRIO 20
#define CS_PERIOD 5000L
#define I2C_POLL_PRIO 20
#define CS_PERIOD 5000L
@@
-115,12
+118,14
@@
struct ballboard {
#define DO_CS 2
#define DO_BD 4
#define DO_POWER 8
#define DO_CS 2
#define DO_BD 4
#define DO_POWER 8
+#define DO_ERRBLOCKING 16
uint8_t flags; /* misc flags */
/* control systems */
struct cs_block roller;
struct cs_block forktrans;
struct cs_block forkrot;
uint8_t flags; /* misc flags */
/* control systems */
struct cs_block roller;
struct cs_block forktrans;
struct cs_block forkrot;
+ struct cs_block beacon;
/* robot status */
uint8_t our_color;
/* robot status */
uint8_t our_color;
@@
-132,7
+137,7
@@
extern struct ballboard ballboard;
/* start the bootloader */
void bootloader(void);
/* start the bootloader */
void bootloader(void);
-#define
wait_cond_or_timeout
(cond, timeout) \
+#define
WAIT_COND_OR_TIMEOUT
(cond, timeout) \
({ \
microseconds __us = time_get_us2(); \
uint8_t __ret = 1; \
({ \
microseconds __us = time_get_us2(); \
uint8_t __ret = 1; \