Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Semerád Pavel
gt3b
Commits
59cb2fe4
Commit
59cb2fe4
authored
May 26, 2011
by
Pavel Semerad
Browse files
modified EEPROM init to eliminate interrupted initialization
parent
c4e9a569
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
59cb2fe4
...
...
@@ -3,6 +3,7 @@
added special chars "-1" and "10" to be able to display values -199...1099
both trims-long now only resets, before there was 1 press of first button
changed EEPROM init to eliminate broken initialization
*0.0.0 (25 May 2011)
...
...
config.c
View file @
59cb2fe4
...
...
@@ -126,17 +126,25 @@ u8 config_global_read(void) {
eeprom_read_global
();
if
(
config_global
.
magic_global
!=
CONFIG_GLOBAL_MAGIC
)
{
// global config changed, initialize whole eeprom
calib_changed
=
config_global_set_default
();
eeprom_write_global
();
eeprom_empty_models
();
calib_changed
=
config_global_set_default
();
// do not write magic_global yet to eliminate interrupted initialization
// (for example flash-verify after flash-write in STVP)
config_global
.
magic_global
=
0
;
config_global_save
();
// and now as last set magic_global
config_global
.
magic_global
=
CONFIG_GLOBAL_MAGIC
;
config_global_save
();
}
else
if
(
config_global
.
magic_model
!=
CONFIG_MODEL_MAGIC
)
{
// model config changed, empty all models
eeprom_empty_models
();
// set model number to 0
config_global
.
model
=
0
;
config_global_save
();
// set new model magic
config_global
.
magic_model
=
CONFIG_MODEL_MAGIC
;
config_global
.
model
=
0
;
config_global_save
();
// model config changed, empty all models
eeprom_empty_models
();
}
return
calib_changed
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment