diff --git a/.vscode/launch.json b/.vscode/launch.json index 5e00f9a..62931d4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,6 +7,13 @@ "name": "Launch firmware/build_nrf52840dk_debug", "config": "${workspaceFolder}/firmware/build_nrf52840dk_debug", "runToEntryPoint": "main" + }, + { + "type": "nrf-connect", + "request": "launch", + "name": "Launch firmware/build_buzzy/firmware", + "config": "${workspaceFolder}/firmware/build_buzzy/firmware", + "runToEntryPoint": "main" } ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 1725e43..11ba84c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,7 @@ ], "cmake.sourceDirectory": "C:/Projekte/buzzer_2/firmware/libs/ble_mgmt", "nrf-connect.debugging.bindings": { - "${workspaceFolder}/firmware/build_nrf52840dk_debug": "Launch firmware/build_nrf52840dk_debug" + "${workspaceFolder}/firmware/build_nrf52840dk_debug": "Launch firmware/build_nrf52840dk_debug", + "${workspaceFolder}/firmware/build_buzzy/firmware": "Launch firmware/build_buzzy/firmware" } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..bd39918 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "MAC RTT Streamer", + "type": "shell", + "command": "bash", + "args": [ + "-c", + "while true; do nc localhost 19021; sleep 0.2; done" + ], + "presentation": { + "echo": false, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true + }, + "runOptions": { + "runOn": "folderOpen" + }, + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/firmware/debug.conf b/firmware/debug.conf index 9f2bc4b..93ca7c1 100644 --- a/firmware/debug.conf +++ b/firmware/debug.conf @@ -9,9 +9,10 @@ CONFIG_INIT_STACKS=y CONFIG_THREAD_STACK_INFO=y ### Lib logging levels -CONFIG_BATT_MGMT_LOG_LEVEL_DBG=y +# CONFIG_BATT_MGMT_LOG_LEVEL_DBG=y # CONFIG_BATT_MGMT_BLINK_INTERVAL_LOGGING=y -CONFIG_USB_MGMT_LOG_LEVEL_DBG=y +# CONFIG_USB_MGMT_LOG_LEVEL_DBG=y +CONFIG_BUZZ_PROTO_LOG_LEVEL_DBG=y ### Bluetooth CONFIG_BLE_MGMT=y diff --git a/firmware/libs/buzz_proto/src/buzz_proto.c b/firmware/libs/buzz_proto/src/buzz_proto.c index 0c00219..580e3f0 100644 --- a/firmware/libs/buzz_proto/src/buzz_proto.c +++ b/firmware/libs/buzz_proto/src/buzz_proto.c @@ -327,6 +327,8 @@ static void handle_batt_info_request(struct buzz_frame_msg *msg) { msg->reply_cb(msg->data_ptr, sizeof(struct buzz_proto_header) + sizeof(struct buzz_resp_batt_info)); } + LOG_DBG("Battery Info sent: state=%u, level=%u, percent=%u, voltage=%u mV", + batt_info.state, batt_info.level, batt_info.percent, batt_info.voltage_mv); } static void handle_ls_request(struct buzz_frame_msg *msg) diff --git a/firmware/src/main.c b/firmware/src/main.c index d564e01..60f42df 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -93,20 +93,6 @@ int main(void) } else { LOG_WRN("Battery info read failed: %d", batt_rc); } - for (;;) { - k_sleep(K_SECONDS(5)); - batt_rc = batt_mgmt_get_info(&batt_info); - if (batt_rc == 0) { - LOG_INF("Battery: %d mV, %u%%, level=%u, state=%s (%d)", - batt_info.voltage_mv, - batt_info.percent, - batt_info.level, - battery_state_to_str(batt_info.state), - batt_info.state); - } else { - LOG_WRN("Battery info read failed: %d", batt_rc); - } - } #endif // CONFIG_BATT_MGMT #endif // CONFIG_LOG