mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-11-24 06:40:21 +03:00
add RS-485
This commit is contained in:
@@ -32,6 +32,7 @@ static int write2flash(const void*, const void*, uint32_t);
|
||||
const user_conf *Flash_Data = (const user_conf *)(&__varsstart);
|
||||
user_conf the_conf = {
|
||||
.userconf_sz = sizeof(user_conf),
|
||||
.usartspeed = 115200,
|
||||
};
|
||||
|
||||
int currentconfidx = -1; // index of current configuration
|
||||
@@ -78,6 +79,7 @@ void flashstorage_init(){
|
||||
if(currentconfidx > -1){
|
||||
memcpy(&the_conf, &Flash_Data[currentconfidx], sizeof(user_conf));
|
||||
}
|
||||
if(the_conf.usartspeed < 1200 || the_conf.usartspeed > 1000000) the_conf.usartspeed = 115200;
|
||||
}
|
||||
|
||||
// store new configuration
|
||||
|
||||
Reference in New Issue
Block a user