Skip to content

Commit

Permalink
make Displayed Temperature moving average filter length a user setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AxxAxx committed Nov 19, 2024
1 parent 94b8955 commit cb1aefc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions AxxSolder_firmware/Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef struct{
double temp_cal_400;
double temp_cal_450;
double serial_debug_print;
double displayed_temp_filter;
}Flash_values;

/* USER CODE END Includes */
Expand Down
13 changes: 9 additions & 4 deletions AxxSolder_firmware/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ Flash_values default_flash_values = {.startup_temperature = 330,
.temp_cal_350 = 350,
.temp_cal_400 = 400,
.temp_cal_450 = 450,
.serial_debug_print = 0};
.serial_debug_print = 0,
.displayed_temp_filter = 5};

/* List of names for settings menu */
#define menu_length 24
char menu_names[menu_length][29] = { "Startup Temp °C ",
#define menu_length 25
char menu_names[menu_length][30] = { "Startup Temp °C ",
"Temp Offset °C ",
"Standby Temp °C ",
"Standby Time [min] ",
Expand All @@ -314,6 +315,7 @@ char menu_names[menu_length][29] = { "Startup Temp °C ",
"Temp cal 400 ",
"Temp cal 450 ",
"Serial DEBUG ",
"Disp Temp. filter ",
"-Load Default- ",
"-Save and Reboot- ",
"-Exit no Save- "};
Expand Down Expand Up @@ -633,6 +635,9 @@ void settings_menu(){
else if (menu_cursor_position == 9){
((double*)&flash_values)[menu_cursor_position] = fmod(round(fmod(fabs(((double*)&flash_values)[menu_cursor_position]), 4)), 4);
}
else if (menu_cursor_position == 21){
((double*)&flash_values)[menu_cursor_position] = 1 + fmod(round(fmod(fabs(((double*)&flash_values)[menu_cursor_position]), 10)), 10);
}
else if (menu_cursor_position == 1){
((double*)&flash_values)[menu_cursor_position] = round(((double*)&flash_values)[menu_cursor_position]);
}
Expand Down Expand Up @@ -1416,7 +1421,7 @@ int main(void)

/* initialize moving average functions */
Moving_Average_Init(&thermocouple_temperature_filter_struct,2);
Moving_Average_Init(&thermocouple_temperature_filtered_filter_struct,50);
Moving_Average_Init(&thermocouple_temperature_filtered_filter_struct,flash_values.displayed_temp_filter*10);
Moving_Average_Init(&requested_power_filtered_filter_struct,20);
Moving_Average_Init(&mcu_temperature_filter_struct,100);
Moving_Average_Init(&input_voltage_filterStruct,25);
Expand Down
Binary file added CAD/AxxSolder_Portable/~$Encolsure_Portable.SLDPRT
Binary file not shown.

0 comments on commit cb1aefc

Please sign in to comment.