diff options
author | marksard <38324387+marksard@users.noreply.github.com> | 2018-08-23 01:51:37 +0900 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-08-22 09:51:37 -0700 |
commit | 6076ed85be111f0e88c7049aa3d2e69eed5005a1 (patch) | |
tree | da704f8828a63245ea2333c883462b2f96591212 /keyboards/crkbd/keymaps/lib/timelogger.c | |
parent | 9d27d5544365b988575ca3face308d30feb40c86 (diff) | |
download | qmk_firmware-6076ed85be111f0e88c7049aa3d2e69eed5005a1.tar.gz |
Keyboard: Partial refactor of the crkbd code (#3600)
* Add display to LED-parameters function
* Improvement of update timing for OLED display (Need TWI_Init)
Diffstat (limited to 'keyboards/crkbd/keymaps/lib/timelogger.c')
-rw-r--r-- | keyboards/crkbd/keymaps/lib/timelogger.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/keyboards/crkbd/keymaps/lib/timelogger.c b/keyboards/crkbd/keymaps/lib/timelogger.c index 0e22bafe7..69828a3a0 100644 --- a/keyboards/crkbd/keymaps/lib/timelogger.c +++ b/keyboards/crkbd/keymaps/lib/timelogger.c @@ -1,17 +1,16 @@ +#include <stdio.h> #include "crkbd.h" -char timelog[40] = {}; +char timelog_str[24] = {}; int last_time = 0; int elapsed_time = 0; -void set_timelog(void) -{ +void set_timelog(void) { elapsed_time = timer_elapsed(last_time); last_time = timer_read(); - snprintf(timelog, sizeof(timelog), "lt:%5d, et:%5d", last_time, elapsed_time); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); } -char *read_timelog(void) -{ - return timelog; +const char *read_timelog(void) { + return timelog_str; } |