Skip to content
Snippets Groups Projects
Commit 3ccf95b2 authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Added calibration resistor values to EEPROM.

parent e5f9af23
Branches
Tags
No related merge requests found
......@@ -30,5 +30,8 @@
#define SETTINGS_R3M_TRIM 0
#define SETTINGS_R30M_TRIM 0
#define SETTINGS_R100M_TRIM 0
#define SETTINGS_EIS_CAL1 3000U
#define SETTINGS_EIS_CAL2 3000000UL
#endif // CONF_BOARD_H
......@@ -31,7 +31,7 @@ void settings_handler(char command){
break;
case 'W': //Write new settings
scanf("%i%hhu%u%i%i%i%i%i%i%i",
scanf("%i%hhu%u%i%i%i%i%i%i%i%lu%lu",
&settings.settings.max5443_offset,
&settings.settings.tcs_enabled,
&settings.settings.tcs_clear_threshold,
......@@ -41,7 +41,9 @@ void settings_handler(char command){
&settings.settings.r300k_trim,
&settings.settings.r3M_trim,
&settings.settings.r30M_trim,
&settings.settings.r100M_trim);
&settings.settings.r100M_trim,
&settings.settings.eis_cal1,
&settings.settings.eis_cal2);
settings_write_eeprom();
break;
......@@ -80,7 +82,9 @@ void settings_read_eeprom(void){
printf("#INFO: r3M_trim = %i\n\r", settings.settings.r3M_trim);
printf("#INFO: r30M_trim = %i\n\r", settings.settings.r30M_trim);
printf("#INFO: r100M_trim = %i\n\r", settings.settings.r100M_trim);
printf("Smax5443_offset.%u:tcs_enabled.%u:tcs_clear_threshold.%u:r100_trim.%i:r3k_trim.%i:r30k_trim.%i:r300k_trim.%i:r3M_trim.%i:r30M_trim.%i:r100M_trim.%i\n\r",
printf("#INFO: eis_cal1 = %lu\n\r", settings.settings.eis_cal1);
printf("#INFO: eis_cal2 = %lu\n\r", settings.settings.eis_cal2);
printf("Smax5443_offset.%u:tcs_enabled.%u:tcs_clear_threshold.%u:r100_trim.%i:r3k_trim.%i:r30k_trim.%i:r300k_trim.%i:r3M_trim.%i:r30M_trim.%i:r100M_trim.%i:eit_cal1.%lu:eis_cal2.%lu\n\r",
settings.settings.max5443_offset,
settings.settings.tcs_enabled,
settings.settings.tcs_clear_threshold,
......@@ -90,7 +94,9 @@ void settings_read_eeprom(void){
settings.settings.r300k_trim,
settings.settings.r3M_trim,
settings.settings.r30M_trim,
settings.settings.r100M_trim);
settings.settings.r100M_trim,
settings.settings.eis_cal1,
settings.settings.eis_cal2);
}
void settings_write_eeprom(void){
......@@ -111,6 +117,8 @@ void settings_restore_defaults(void){
settings.settings.r3M_trim = SETTINGS_R3M_TRIM;
settings.settings.r30M_trim = SETTINGS_R30M_TRIM;
settings.settings.r100M_trim = SETTINGS_R100M_TRIM;
settings.settings.eis_cal1 = SETTINGS_EIS_CAL1;
settings.settings.eis_cal2 = SETTINGS_EIS_CAL2;
settings_write_eeprom();
}
......
......@@ -28,7 +28,9 @@ struct settings_list { //Make sure this doesn't exceed 32 bytes
int16_t r300k_trim;
int16_t r3M_trim;
int16_t r30M_trim;
int16_t r100M_trim; //20 bytes
int16_t r100M_trim;
uint32_t eis_cal1;
uint32_t eis_cal2; //28 bytes
};
union {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment