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:
Oskar Weigl
2019-12-04 14:43:35 -08:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+4 -2
View File
@@ -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;
}
-2
View File
@@ -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`.