Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
protocentralashwin committed Nov 12, 2023
1 parent 0444063 commit b08afb6
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 62 deletions.
3 changes: 1 addition & 2 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ sample:
common:
build_only: true
integration_platforms:
- custom_plank
- nucleo_f302r8
- healthypi5_rp2040
tests:
app.default: {}
app.debug:
Expand Down
6 changes: 3 additions & 3 deletions app/src/ble_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
20 changes: 0 additions & 20 deletions app/src/cmd_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions app/src/data_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#include <zephyr/random/rand32.h>

#include "max30001.h"

#include "data_module.h"
#include "hw_module.h"
#include "cmd_module.h"
#include "sampling_module.h"
#include "algos.h"

#ifdef CONFIG_HEALTHYPI_DISPLAY_ENABLED
#include "display_module.h"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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());
}
Expand Down
14 changes: 4 additions & 10 deletions app/src/display/display_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 5 additions & 7 deletions app/src/fs_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
///}
}
}
2 changes: 2 additions & 0 deletions app/src/fs_module.h
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
12 changes: 1 addition & 11 deletions app/src/hw_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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!");
Expand All @@ -360,7 +350,7 @@ void hw_thread(void)
}

leds_init();
//buttons_init();
buttons_init();

fs_module_init();

Expand Down
3 changes: 1 addition & 2 deletions tests/lib/custom_lib/prj.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
CONFIG_ZTEST=y
CONFIG_CUSTOM_LIB=y
CONFIG_ZTEST=y
2 changes: 1 addition & 1 deletion tests/lib/custom_lib/testcase.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
common:
tags: extensibility
integration_platforms:
- custom_plank
- healthypi5_rp2040
- qemu_cortex_m0
tests:
lib.custom_lib: {}
Expand Down

0 comments on commit b08afb6

Please sign in to comment.