From 4e52fd837f1c423c424e12ddffeb0c459da0d2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Mon, 21 Mar 2022 15:10:45 +0100 Subject: [PATCH] Update ThingSet library (new NVM handling) --- app/src/data_objects.cpp | 2 ++ app/src/ext/can.cpp | 4 ---- app/src/ext/serial.cpp | 5 ----- west.yml | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/data_objects.cpp b/app/src/data_objects.cpp index 732d347..bf1e790 100644 --- a/app/src/data_objects.cpp +++ b/app/src/data_objects.cpp @@ -1187,6 +1187,8 @@ void data_objects_init() else { battery_conf_overwrite(&bat_conf, &bat_conf_user); } + + ts.set_update_callback(SUBSET_NVM, data_objects_update_conf); } void thingset_auth() diff --git a/app/src/ext/can.cpp b/app/src/ext/can.cpp index 817ddca..09d9a9d 100644 --- a/app/src/ext/can.cpp +++ b/app/src/ext/can.cpp @@ -117,10 +117,6 @@ void can_isotp_thread() LOG_INF("Got %d bytes via ISO-TP. Processing ThingSet message.", req_len); resp_len = ts.process(rx_buffer, req_len, tx_buffer, sizeof(tx_buffer)); LOG_DBG("TX buf: %x %x %x %x", tx_buffer[0], tx_buffer[1], tx_buffer[2], tx_buffer[3]); - - if (ts.check_updated(SUBSET_NVM, true)) { - data_objects_update_conf(); - } } else { tx_buffer[0] = TS_STATUS_INTERNAL_SERVER_ERR; diff --git a/app/src/ext/serial.cpp b/app/src/ext/serial.cpp index 235cf75..9f8afdc 100644 --- a/app/src/ext/serial.cpp +++ b/app/src/ext/serial.cpp @@ -65,11 +65,6 @@ void serial_process_command() uart_poll_out(uart_dev, tx_buf[i]); } uart_poll_out(uart_dev, '\n'); - - if (ts.check_updated(SUBSET_NVM, true)) { - // ToDo: This could take a few milliseconds, better offload from ISR context - data_objects_update_conf(); - } } // release buffer and start waiting for new commands diff --git a/west.yml b/west.yml index 62bcefb..7db97e9 100644 --- a/west.yml +++ b/west.yml @@ -23,7 +23,7 @@ manifest: path: modules/oled-display - name: thingset-device-library remote: thingset - revision: 727cb4da825e3e97e9066a5c62ba838514f853ca + revision: 5c2b562d77cd44969c822bbd8c37cd7394d5ca58 path: modules/thingset - name: unity remote: throwtheswitch