mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-20 22:14:34 +08:00
Merge pull request #371 from madcowswe/sam_nvm_fix
Fix NVM bug that prevented from saving configuration three times in a row
This commit is contained in:
@@ -362,10 +362,12 @@ int NVM_commit(void) {
|
||||
read_sector_ = 1 - read_sector_;
|
||||
|
||||
// invalidate the other sector
|
||||
if (read_sector->index < read_sector->n_data)
|
||||
if (read_sector->index < read_sector->n_data) {
|
||||
status = set_allocation_state(read_sector, read_sector->index, 1, INVALID);
|
||||
else
|
||||
read_sector->index += 1;
|
||||
} else {
|
||||
status = erase(read_sector);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -218,8 +218,6 @@ This is 4x the Pulse Per Revolution (PPR) value. Usually this is indicated in th
|
||||
You can save all `.config` parameters to persistent memory so the ODrive remembers them between power cycles.
|
||||
* `odrv0.save_configuration()` <kbd>Enter</kbd>.
|
||||
|
||||
Due to a [known issue](https://github.com/madcowswe/ODrive/issues/183) it is strongly recommended that you reboot following every save of your configuration using `odrv0.reboot()`.
|
||||
|
||||
|
||||
## Position control of M0
|
||||
Let's get motor 0 up and running. The procedure for motor 1 is exactly the same, so feel free to substitute `axis0` wherever it says `axis0`.
|
||||
|
||||
Reference in New Issue
Block a user