Skip to content

Commit

Permalink
fixed eeprom buffer alignment, fixed phaseout includes
Browse files Browse the repository at this point in the history
  • Loading branch information
freasy committed Aug 8, 2024
1 parent 81b173f commit 614fb33
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Inc/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ typedef union EEprom_u {
uint8_t tune[124]; // 52-175
//eeprom v3
uint8_t auto_advance; // 176
char unused[7]; //177-183
};
uint8_t buffer[177];
uint8_t buffer[184];
} EEprom_t;

extern EEprom_t eepromBuffer;
Expand Down
1 change: 1 addition & 0 deletions Mcu/e230/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(int newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/f031/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(int newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/f051/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(char newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/f415/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(int newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/g071/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(int newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/g431/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(int newStep);
Expand Down
1 change: 1 addition & 0 deletions Mcu/l431/Inc/phaseouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define INC_PHASEOUTS_H_

#include "main.h"
#include "common.h"

void allOff();
void comStep(char newStep);
Expand Down
7 changes: 7 additions & 0 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,13 @@ void loadEEpromSettings()
high_rpm_level = motor_kv / 12 / (32 / eepromBuffer.motor_poles);
}
reverse_speed_threshold = map(motor_kv, 300, 3000, 1000, 500);

if (eepromBuffer.eeprom_version > 2) {
if (eepromBuffer.auto_advance > 1) {
eepromBuffer.auto_advance = 0;
save_flash_nolib(eepromBuffer.buffer, sizeof(eepromBuffer.buffer), eeprom_address);
}
}
// reverse_speed_threshold = 200;
// if (!eepromBuffer.comp_pwm) {
// eepromBuffer.bi_direction = 0;
Expand Down

0 comments on commit 614fb33

Please sign in to comment.