/* Configure external components */
int external_components_config(uint32_t uart)
{
+ int i = 0;
+
/* RTC : must be done first to be able to access RTC RAM for uSD init */
scialys_time_config(I2C0, RTC_ADDR);
scialys_time_init_check(uart);
/* Thermocouple configuration */
max31855_sensor_config(&thermocouple);
+ /* Fill the water temp table so the average value is accurate */
+ for (i = 0; i < WTA_NB_VAL; i++) {
+ water_temp_update(uart);
+ msleep(5);
+ }
/* TMP101 sensor config on power board */
power_board_present = power_board_temp_sensor_config(uart);
/***************************************************************************** */
/* Update water tank temperature */
+static int water_centi_average[WTA_NB_VAL] = {0};
+
int water_temp_update(uint32_t uart)
{
- static int water_centi_average[WTA_NB_VAL];
static int wta_idx = 0;
int water_centi_degrees = 0;
int ret = 0, i = 0;