summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/eeconfig.c3
-rw-r--r--tmk_core/common/eeconfig.h1
-rw-r--r--tmk_core/common/keyboard.c6
-rw-r--r--tmk_core/common/test/timer.c21
-rw-r--r--tmk_core/common/wait.h6
5 files changed, 27 insertions, 10 deletions
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index 140d2b85b..e2eb4a38e 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -19,6 +19,9 @@ void eeconfig_init(void)
#ifdef RGBLIGHT_ENABLE
eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
#endif
+#ifdef STENO_ENABLE
+ eeprom_update_byte(EECONFIG_STENOMODE, 0);
+#endif
}
void eeconfig_enable(void)
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index 280dc7ab6..ce60ca866 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define EECONFIG_AUDIO (uint8_t *)7
#define EECONFIG_RGBLIGHT (uint32_t *)8
#define EECONFIG_UNICODEMODE (uint8_t *)12
+#define EECONFIG_STENOMODE (uint8_t *)13
/* debug bit */
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 97a8f1cd8..9466e10e2 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -51,6 +51,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGBLIGHT_ENABLE
# include "rgblight.h"
#endif
+#ifdef STENO_ENABLE
+# include "process_steno.h"
+#endif
#ifdef FAUXCLICKY_ENABLE
# include "fauxclicky.h"
#endif
@@ -139,6 +142,9 @@ void keyboard_init(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
+#ifdef STENO_ENABLE
+ steno_init();
+#endif
#ifdef FAUXCLICKY_ENABLE
fauxclicky_init();
#endif
diff --git a/tmk_core/common/test/timer.c b/tmk_core/common/test/timer.c
index 09ea91a89..19e79e1f5 100644
--- a/tmk_core/common/test/timer.c
+++ b/tmk_core/common/test/timer.c
@@ -16,15 +16,20 @@
#include "timer.h"
-// TODO: the timer should work, but at a much faster rate than realtime
-// It should also have some kind of integration with the testing system
+static uint32_t current_time = 0;
-void timer_init(void) {}
+void timer_init(void) {current_time = 0;}
-void timer_clear(void) {}
+void timer_clear(void) {current_time = 0;}
-uint16_t timer_read(void) { return 0; }
-uint32_t timer_read32(void) { return 0; }
-uint16_t timer_elapsed(uint16_t last) { return 0; }
-uint32_t timer_elapsed32(uint32_t last) { return 0; }
+uint16_t timer_read(void) { return current_time & 0xFFFF; }
+uint32_t timer_read32(void) { return current_time; }
+uint16_t timer_elapsed(uint16_t last) { return TIMER_DIFF_16(timer_read(), last); }
+uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), last); }
+void set_time(uint32_t t) { current_time = t; }
+void advance_time(uint32_t ms) { current_time += ms; }
+
+void wait_ms(uint32_t ms) {
+ advance_time(ms);
+} \ No newline at end of file
diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h
index 911c9ddb5..bdcb3f2a4 100644
--- a/tmk_core/common/wait.h
+++ b/tmk_core/common/wait.h
@@ -1,6 +1,8 @@
#ifndef WAIT_H
#define WAIT_H
+#include <inttypes.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -16,8 +18,8 @@ extern "C" {
#elif defined(__arm__)
# include "wait_api.h"
#else // Unit tests
-#define wait_ms(ms)
-#define wait_us(us)
+void wait_ms(uint32_t ms);
+#define wait_us(us) wait_ms(us / 1000)
#endif
#ifdef __cplusplus