diff --git a/app/sample.yaml b/app/sample.yaml index 582bb8f..3d23930 100644 --- a/app/sample.yaml +++ b/app/sample.yaml @@ -7,8 +7,7 @@ sample: common: build_only: true integration_platforms: - - custom_plank - - nucleo_f302r8 + - healthypi5_rp2040 tests: app.default: {} app.debug: diff --git a/app/src/ble_module.c b/app/src/ble_module.c index 24f0227..055d61c 100644 --- a/app/src/ble_module.c +++ b/app/src/ble_module.c @@ -122,7 +122,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) } } -static void security_changed(struct bt_conn *conn, bt_security_t level, +/*static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_security_err err) { char addr[BT_ADDR_LE_STR_LEN]; @@ -138,7 +138,7 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, printk("Security failed: %s level %u err %d\n", addr, level, err); } -} +}*/ BT_CONN_CB_DEFINE(conn_callbacks) = { .connected = connected, @@ -233,5 +233,5 @@ void ble_module_init() bt_ready(); - // bt_conn_auth_cb_register(&auth_cb_display); + bt_conn_auth_cb_register(&auth_cb_display); } \ No newline at end of file diff --git a/app/src/cmd_module.c b/app/src/cmd_module.c index a200f78..159bcab 100644 --- a/app/src/cmd_module.c +++ b/app/src/cmd_module.c @@ -181,26 +181,6 @@ void cmdif_send_ble_progress(uint8_t m_stage, uint16_t m_total_time, uint16_t m_ } } -static void cmdif_send_ble_status(uint8_t m_cmd, uint8_t m_value) -{ - printk("Sending BLE Status: %X %X\n", m_cmd, m_value); - uint8_t cmd_pkt[9]; - cmd_pkt[0] = CES_CMDIF_PKT_START_1; - cmd_pkt[1] = CES_CMDIF_PKT_START_2; - cmd_pkt[2] = 0x02; - cmd_pkt[3] = 0x00; - cmd_pkt[4] = CES_CMDIF_TYPE_STATUS; - cmd_pkt[5] = m_cmd; - cmd_pkt[6] = m_value; - cmd_pkt[7] = CES_CMDIF_PKT_STOP_1; - cmd_pkt[8] = CES_CMDIF_PKT_STOP_2; - - for (int i = 0; i < 9; i++) - { - //uart_poll_out(esp_uart_dev, cmd_pkt[i]); - } -} - void cmdif_send_ble_device_status_response(void) { //cmdif_send_ble_status(WISER_CMD_GET_DEVICE_STATUS, global_dev_status); diff --git a/app/src/data_module.c b/app/src/data_module.c index 4903877..71a957e 100644 --- a/app/src/data_module.c +++ b/app/src/data_module.c @@ -3,7 +3,6 @@ #include #include #include -#include #include "max30001.h" @@ -11,6 +10,7 @@ #include "hw_module.h" #include "cmd_module.h" #include "sampling_module.h" +#include "algos.h" #ifdef CONFIG_HEALTHYPI_DISPLAY_ENABLED #include "display_module.h" @@ -62,7 +62,7 @@ struct hpi_sensor_data_t log_buffer[LOG_BUFFER_LENGTH]; uint16_t current_session_log_counter = 0; uint16_t current_session_log_id = 0; -char session_id_str[5]; +char session_id_str[15]; void sendData(int32_t ecg_sample, int32_t bioz_sample, int32_t raw_red, int32_t raw_ir, int32_t temp, uint8_t hr, uint8_t rr, uint8_t spo2, bool _bioZSkipSample) @@ -119,9 +119,9 @@ void sendData(int32_t ecg_sample, int32_t bioz_sample, int32_t raw_red, int32_t if (settings_send_rpi_uart_enabled) { - send_rpi_uart(DataPacketHeader, 5); - send_rpi_uart(DataPacket, DATA_LEN); - send_rpi_uart(DataPacketFooter, 2); + //send_rpi_uart(DataPacketHeader, 5); + //send_rpi_uart(DataPacket, DATA_LEN); + //send_rpi_uart(DataPacketFooter, 2); } } @@ -171,7 +171,7 @@ void record_init_session_log() } current_session_log_counter = 0; - current_session_log_id = (uint16_t)sys_rand32_get(); // Create random session ID + //current_session_log_id = (uint16_t)sys_rand32_get(); // Create random session ID // printk("Init Session ID %s \n", log_get_current_session_id_str()); } diff --git a/app/src/display/display_module.c b/app/src/display/display_module.c index 2d12c6f..6d739fc 100644 --- a/app/src/display/display_module.c +++ b/app/src/display/display_module.c @@ -60,9 +60,8 @@ static lv_style_t style_h2; static lv_style_t style_info; static lv_style_t style_icon; -static lv_obj_t *roller_session_select; - -static lv_obj_t *label_current_mode; +//static lv_obj_t *roller_session_select; +//static lv_obj_t *label_current_mode; static lv_obj_t *label_batt_level; static lv_obj_t *label_batt_level_val; @@ -540,7 +539,7 @@ void draw_scr_chart_single(uint8_t m_data_type) lv_obj_add_style(scr_chart_single, &style_scr_back, 0); - lv_group_t *g1 = lv_group_create(); + //lv_group_t *g1 = lv_group_create(); // Create Chart 1 chart1 = lv_chart_create(scr_chart_single); @@ -590,11 +589,6 @@ static void anim_x_cb(void *var, int32_t v) lv_obj_set_x(var, v); } -static void anim_size_cb(void *var, int32_t v) -{ - lv_obj_set_size(var, v, v); -} - void draw_scr_welcome(void) { static lv_grad_dsc_t grad; @@ -709,7 +703,7 @@ void display_screens_thread(void) draw_scr_welcome(); - int sample_count = 0; + //int sample_count = 0; while (1) { k_msgq_get(&q_plot, &sensor_sample, K_FOREVER); diff --git a/app/src/fs_module.c b/app/src/fs_module.c index fdb0347..fed652f 100644 --- a/app/src/fs_module.c +++ b/app/src/fs_module.c @@ -50,8 +50,6 @@ uint16_t length_1_val = 40; uint32_t length_2_val = 60; int32_t voltage_val = -3000; - - static int littlefs_flash_erase(unsigned int id) { const struct flash_area *pfa; @@ -389,10 +387,10 @@ void fs_module_init(void) sbuf.f_bsize, sbuf.f_frsize, sbuf.f_blocks, sbuf.f_bfree); - //rc = lsdir("/lfs/log"); - //if (rc < 0) - //{ - // LOG_PRINTK("FAIL: lsdir %s: %d\n", mp->mnt_point, rc); + rc = lsdir("/lfs/log"); + if (rc < 0) + { + LOG_PRINTK("FAIL: lsdir %s: %d\n", mp->mnt_point, rc); // goto out; - ///} + } } \ No newline at end of file diff --git a/app/src/fs_module.h b/app/src/fs_module.h index 9fb58c2..d4b1d5e 100644 --- a/app/src/fs_module.h +++ b/app/src/fs_module.h @@ -1,6 +1,8 @@ #ifndef fs_module_h #define fs_module_h +#include "sampling_module.h" + void fs_module_init(void); void init_settings(void); void record_write_to_file(int current_session_log_id, int current_session_log_counter, struct hpi_sensor_data_t *current_session_log_points); diff --git a/app/src/hw_module.c b/app/src/hw_module.c index 4759854..0f23893 100644 --- a/app/src/hw_module.c +++ b/app/src/hw_module.c @@ -226,14 +226,6 @@ void send_usb_cdc(const char *buf, size_t len) uart_irq_tx_enable(usb_dev); } -// TODO: implement RPI UART -void send_rpi_uart(const char *buf, size_t len) -{ - int rb_len; - // rb_len = ring_buf_put(&ringbuf_uart, buf, len); - // uart_irq_tx_enable(uart_dev); -} - static void interrupt_handler(const struct device *dev, void *user_data) { ARG_UNUSED(user_data); @@ -333,8 +325,6 @@ uint8_t read_battery_level(void) void hw_thread(void) { - int ret = 0; - if (!device_is_ready(max30001_dev)) { printk("MAX30001 device not found!"); @@ -360,7 +350,7 @@ void hw_thread(void) } leds_init(); - //buttons_init(); + buttons_init(); fs_module_init(); diff --git a/tests/lib/custom_lib/prj.conf b/tests/lib/custom_lib/prj.conf index f70c400..0fdb432 100644 --- a/tests/lib/custom_lib/prj.conf +++ b/tests/lib/custom_lib/prj.conf @@ -1,2 +1 @@ -CONFIG_ZTEST=y -CONFIG_CUSTOM_LIB=y +CONFIG_ZTEST=y \ No newline at end of file diff --git a/tests/lib/custom_lib/testcase.yaml b/tests/lib/custom_lib/testcase.yaml index 9055f67..a59cfc1 100644 --- a/tests/lib/custom_lib/testcase.yaml +++ b/tests/lib/custom_lib/testcase.yaml @@ -1,7 +1,7 @@ common: tags: extensibility integration_platforms: - - custom_plank + - healthypi5_rp2040 - qemu_cortex_m0 tests: lib.custom_lib: {}