Skip to content

Commit 758225a

Browse files
committed
Adjust some logs.
1 parent bf332a1 commit 758225a

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

right/src/i2c_watchdog.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#include "trace.h"
1111
#include "slave_protocol.h"
1212

13+
14+
#ifdef __ZEPHYR__
15+
#include <zephyr/logging/log.h>
16+
LOG_MODULE_REGISTER(I2cWatchdog, LOG_LEVEL_INF);
17+
#endif
18+
1319
uint32_t I2cWatchdog_WatchCounter;
1420
uint32_t I2cWatchdog_RecoveryCounter;
1521

@@ -30,6 +36,7 @@ void PIT_I2C_WATCHDOG_HANDLER(void)
3036
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there haven't been any interrupts recently
3137
I2cWatchdog_RecoveryCounter++;
3238
ReinitI2cMainBus();
39+
LOG_ERR("I2C bus unresponsive, reinitializing. Recovery count: %d\n", I2cWatchdog_RecoveryCounter);
3340
}
3441

3542
prevWatchdogCounter = I2C_Watchdog;

right/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int main(void)
235235
sendFirstReport();
236236

237237
Trace_Printc("initialized");
238-
LOG_INF("Booted up");
238+
LOG_INF("Booted up.\n");
239239

240240
while (1) {
241241
Trace_Printc("{");

right/src/usb_report_sender.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "trace.h"
2020
#include "utils.h"
2121
#include "slave_drivers/uhk_module_driver.h"
22+
#include <errno.h>
2223

2324
#ifdef __ZEPHYR__
2425
#include "keyboard/input_interceptor.h"
@@ -63,7 +64,7 @@ bool UsbReportSender_ShouldGiveUp(int err, uint8_t* counter) {
6364
return true;
6465
}
6566

66-
if (*counter == 1) {
67+
if (*counter == 1 && err != -EBUSY) {
6768
LOG_WRN("Send try failed, result: %d (%s). Will retry.\n", err, ErrToStr(err));
6869
}
6970

0 commit comments

Comments
 (0)