summaryrefslogtreecommitdiff
path: root/n/asserv/src/eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/asserv/src/eeprom.c')
-rw-r--r--n/asserv/src/eeprom.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/n/asserv/src/eeprom.c b/n/asserv/src/eeprom.c
index 4cd3a10..b454fdd 100644
--- a/n/asserv/src/eeprom.c
+++ b/n/asserv/src/eeprom.c
@@ -23,7 +23,7 @@
* }}} */
#include <avr/eeprom.h>
-#define EEPROM_KEY 0xa7
+#define EEPROM_KEY 0xa9
/* +AutoDec */
/* -AutoDec */
@@ -37,13 +37,17 @@ eeprom_read_params (void)
if (eeprom_read_byte (p8++) != EEPROM_KEY)
return;
speed_acc_cpt = speed_acc = eeprom_read_byte (p8++);
- speed_max = eeprom_read_byte (p8++);
+ speed_max_l = eeprom_read_byte (p8++);
+ speed_max_a = eeprom_read_byte (p8++);
speed_ds = eeprom_read_byte (p8++);
pwm_dir = eeprom_read_byte (p8++);
p16 = (uint16_t *) p8;
- speed_kp = eeprom_read_word (p16++);
- speed_ki = eeprom_read_word (p16++);
- speed_kd = eeprom_read_word (p16++);
+ speed_left_kp = eeprom_read_word (p16++);
+ speed_right_kp = eeprom_read_word (p16++);
+ speed_left_ki = eeprom_read_word (p16++);
+ speed_right_ki = eeprom_read_word (p16++);
+ speed_left_kd = eeprom_read_word (p16++);
+ speed_right_kd = eeprom_read_word (p16++);
speed_e_sat = eeprom_read_word (p16++);
speed_int_sat = eeprom_read_word (p16++);
postrack_set_footing (eeprom_read_word (p16++));
@@ -57,13 +61,17 @@ eeprom_write_params (void)
uint16_t *p16;
eeprom_write_byte (p8++, EEPROM_KEY);
eeprom_write_byte (p8++, speed_acc);
- eeprom_write_byte (p8++, speed_max);
+ eeprom_write_byte (p8++, speed_max_l);
+ eeprom_write_byte (p8++, speed_max_a);
eeprom_write_byte (p8++, speed_ds);
eeprom_write_byte (p8++, pwm_dir);
p16 = (uint16_t *) p8;
- eeprom_write_word (p16++, speed_kp);
- eeprom_write_word (p16++, speed_ki);
- eeprom_write_word (p16++, speed_kd);
+ eeprom_write_word (p16++, speed_left_kp);
+ eeprom_write_word (p16++, speed_right_kp);
+ eeprom_write_word (p16++, speed_left_ki);
+ eeprom_write_word (p16++, speed_right_ki);
+ eeprom_write_word (p16++, speed_left_kd);
+ eeprom_write_word (p16++, speed_right_kd);
eeprom_write_word (p16++, speed_e_sat);
eeprom_write_word (p16++, speed_int_sat);
eeprom_write_word (p16++, postrack_footing);