mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-02-28 11:54:30 +03:00
3steppers: fix some bugs, add commands eraseflash and setpos
This commit is contained in:
@@ -112,7 +112,7 @@ int store_userconf(){
|
||||
// for binarySearch() checking that there's nothing more after it!
|
||||
if(currentconfidx > (int)maxCnum - 3){ // there's no more place
|
||||
currentconfidx = 0;
|
||||
if(erase_flash(Flash_Data, (&__varsstart))) return 1;
|
||||
if(erase_flash(Flash_Data, NULL)) return 1;
|
||||
}else ++currentconfidx; // take next data position (0 - within first run after firmware flashing)
|
||||
return write2flash((const void*)&Flash_Data[currentconfidx], &the_conf, sizeof(the_conf));
|
||||
}
|
||||
@@ -241,3 +241,7 @@ void dump_userconf(_U_ char *txt){
|
||||
}
|
||||
NL();
|
||||
}
|
||||
|
||||
int erase_storage(){
|
||||
return erase_flash(Flash_Data, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user