# CONFIG_MODULE_FIXED_POINT is not set
# CONFIG_MODULE_VECT2 is not set
# CONFIG_MODULE_GEOMETRY is not set
-# CONFIG_MODULE_GEOMETRY_CREATE_CONFIG is not set
+# CONFIG_MODULE_HOSTSIM is not set
# CONFIG_MODULE_SCHEDULER is not set
+# CONFIG_MODULE_SCHEDULER_STATS is not set
# CONFIG_MODULE_SCHEDULER_CREATE_CONFIG is not set
# CONFIG_MODULE_SCHEDULER_USE_TIMERS is not set
CONFIG_MODULE_SCHEDULER_TIMER0=y
# CONFIG_MODULE_ENCODERS_SPI_CREATE_CONFIG is not set
#
-# Robot specific modules
+# Robot specific modules (fixed point lib may be needed)
#
# CONFIG_MODULE_ROBOT_SYSTEM is not set
+# CONFIG_MODULE_ROBOT_SYSTEM_USE_F64 is not set
# CONFIG_MODULE_ROBOT_SYSTEM_MOT_AND_EXT is not set
# CONFIG_MODULE_POSITION_MANAGER is not set
+# CONFIG_MODULE_COMPENSATE_CENTRIFUGAL_FORCE is not set
# CONFIG_MODULE_TRAJECTORY_MANAGER is not set
# CONFIG_MODULE_BLOCKING_DETECTION_MANAGER is not set
# CONFIG_MODULE_OBSTACLE_AVOIDANCE is not set
-/*
+/*
* Copyright Droids Corporation
* Olivier Matz <zer0@droids-corp.org>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
#endif
-static char uart_recv(void)
-{
- while ( !(UCSRxA & (1<<RXCx)) ) ;
- return UDRx;
+static char uart_recv(void)
+{
+ while ( !(UCSRxA & (1<<RXCx)) ) ;
+ return UDRx;
}
-static void uart_send(char c)
-{
+static void uart_send(char c)
+{
while ( !( UCSRxA & (1<<UDREx)) ) ;
- UDRx = c;
+ UDRx = c;
}
static void uart_puts(const char *buf)
else if (c >= '0' && c <= '9') {
tmp <<= 4;
tmp += (c - '0');
- }
+ }
else if (c >= 'a' && c <= 'f') {
tmp <<= 4;
tmp += (c - 'a' + 10);
- }
+ }
else if (c >= 'A' && c <= 'F') {
tmp <<= 4;
tmp += (c - 'A' + 10);
- }
+ }
else
return -1;
}
disp_hex8(x);
}
+static void disp_hex32(uint32_t x)
+{
+ disp_hex16(x>>16);
+ disp_hex16(x);
+}
+
static void crc_app(void)
{
uint32_t start_addr, addr, size;
val <<= 8;
val |= c;
}
- disp_hex16(val);
+ disp_hex32(val);
return;
fail:
uart_puts("KO");
eeprom_busy_wait();
boot_page_erase(addr);
boot_spm_busy_wait();
-
+
/* Set up little-endian word and fill tmp buf. */
for (i=0; i<SPM_PAGESIZE; i+=2) {
uint16_t w = buf[i] + ((uint16_t)(buf[i+1]) << 8);
boot_page_fill(addr + i, w);
}
-
+
PORTJ = 0xFC;
boot_page_write(addr);
boot_spm_busy_wait();
-
+
/* Reenable RWW-section again. We need this if we want to jump
* back to the application after bootloading. */
boot_rww_enable();
-
+
uart_puts("OK");
return;
fail:
else
uart_puts("p:prog_page c:crc x:exec d:dump32");
}
-
+
return 0;
}