summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon')
-rw-r--r--digital/beacon/src/codewheel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/digital/beacon/src/codewheel.c b/digital/beacon/src/codewheel.c
index 73c0329f..cfa2e761 100644
--- a/digital/beacon/src/codewheel.c
+++ b/digital/beacon/src/codewheel.c
@@ -111,7 +111,12 @@ ISR(TIMER3_COMPA_vect)
{
if(codewheel_get_state() == CODEWHEEL_REQUEST_REBASE)
{
- OCR3A = codewheel_get_rebase_offset();
+ /* if rebase offset is too short, wait 1 turn before doing it */
+ if(codewheel_get_rebase_offset() < 60)
+ OCR3A = CODEWHEEL_CPR+codewheel_get_rebase_offset();
+ else
+ OCR3A = codewheel_get_rebase_offset();
+
codewheel_set_state(CODEWHEEL_REBASED);
uprintf("Rebased\r\n");
}