Skip to content

Commit db5d3a4

Browse files
author
mkuettner97
committed
clearn up
1 parent 55879ef commit db5d3a4

6 files changed

Lines changed: 5 additions & 33 deletions

File tree

src/Battery/PowerManager.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,11 @@
88
#include <zephyr/logging/log.h>
99
LOG_MODULE_REGISTER(battery_pub, CONFIG_MODULE_BUTTON_HANDLER_LOG_LEVEL);
1010

11-
//K_MSGQ_DEFINE(battery_queue, sizeof(struct battery_data), 1, 4);
12-
1311
struct load_switch_data {
1412
struct gpio_dt_spec ctrl_pin;
1513
bool default_on;
1614
};
1715

18-
/*
19-
void battery_chan_update() {
20-
int ret;
21-
22-
while (1) {
23-
k_msgq_get(&battery_queue, &pm_msg, K_FOREVER);
24-
25-
ret = zbus_chan_pub(&battery_chan, &pm_msg, K_FOREVER); //K_NO_WAIT
26-
if (ret) {
27-
LOG_ERR("Failed to publish battery msg, ret: %d", ret);
28-
}
29-
}
30-
}
31-
32-
K_THREAD_DEFINE(battery_publish, 1024, battery_chan_update, NULL, NULL, //CONFIG_BUTTON_PUBLISH_STACK_SIZE
33-
NULL, K_PRIO_PREEMPT(CONFIG_BUTTON_PUBLISH_THREAD_PRIO), 0, 0); //CONFIG_BUTTON_PUBLISH_THREAD_PRIO
34-
*/
35-
36-
3716
static int b_init(const struct device *dev)
3817
{
3918
ARG_UNUSED(dev);

src/SD_Card/SDLogger/SDLogger.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ void sd_listener_callback(const struct zbus_channel *chan)
6262
power_manager.set_error_led();
6363
LOG_ERR("SD card removed mid recording. Stop recording.");
6464

65-
sdlogger.end();
65+
// sdlogger.end();
66+
sdlogger.is_open = false;
6667
}
6768
}
6869

src/SensorManager/SensorManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ static struct k_work config_work;
5050

5151
struct k_work_q sensor_work_q;
5252

53+
K_THREAD_STACK_DEFINE(sensor_publish_thread_stack, CONFIG_SENSOR_PUB_STACK_SIZE);
54+
5355
int active_sensors = 0;
5456

5557
static void config_work_handler(struct k_work *work);
@@ -69,8 +71,6 @@ void sensor_chan_update(void *p1, void *p2, void *p3) {
6971
}
7072
}
7173

72-
K_THREAD_STACK_DEFINE(sensor_publish_thread_stack, CONFIG_SENSOR_PUB_STACK_SIZE);
73-
7474
void init_sensor_manager() {
7575
_state = INIT;
7676

src/bluetooth/gatt_services/battery_service.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ LOG_MODULE_REGISTER(battery_service, CONFIG_MODULE_BUTTON_HANDLER_LOG_LEVEL);
1717
static struct battery_data msg;
1818
static bool notify_enabled;
1919

20-
//DEFINE_GATT_SERVICE(battery, bt_send_battery_level, &msg); //(power_manager);
21-
2220
static struct k_thread thread_data;
2321
static k_tid_t thread_id;
2422

src/bluetooth/gatt_services/led_service.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ static ssize_t write_led(struct bt_conn *conn,
1010
const void *buf,
1111
uint16_t len, uint16_t offset, uint8_t flags)
1212
{
13-
//printk("Attribute write, handle: %u, conn: %p", attr->handle,
14-
//(void *)conn);
15-
1613
if (len != 3U) {
1714
LOG_INF("Write led: Incorrect data length");
1815
return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN);
@@ -23,9 +20,6 @@ static ssize_t write_led(struct bt_conn *conn,
2320
return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET);
2421
}
2522

26-
//earable_led.set_color((uint8_t*)buf);
27-
//led_controller.setColor((uint8_t*)buf);
28-
2923
state_indicator.set_custom_color((uint8_t *) buf);
3024

3125
return len;

src/buttons/button_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ void button_pub_task() {
2828
}
2929
}
3030

31-
K_THREAD_DEFINE(button_publish, 1024, button_pub_task, NULL, NULL, //CONFIG_BUTTON_PUBLISH_STACK_SIZE
31+
K_THREAD_DEFINE(button_publish, CONFIG_BUTTON_PUBLISH_STACK_SIZE, button_pub_task, NULL, NULL,
3232
NULL, K_PRIO_PREEMPT(CONFIG_BUTTON_PUBLISH_THREAD_PRIO), 0, 0);

0 commit comments

Comments
 (0)