Skip to content

redo state algorithm #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2018
Merged

redo state algorithm #1

merged 1 commit into from
Jun 1, 2018

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jun 1, 2018

This is a redo of the rotary encoder algorithm. It was inspired by some simpler versions I found last night, like: https://www.mikrocontroller.net/articles/Drehgeber#Dekoder_f.C3.BCr_Drehgeber_mit_wackeligen_Rastpunktenr (not that I can read German; hurray Google Translate)

But I haven't see anyone else do the quarter_count business, which I think is an easier way to keep track of the history of the previous states. It's easier to understand than the bigger state tables in https://github.com/buxtronix/arduino/blob/master/libraries/Rotary/Rotary.cpp.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Jun 1, 2018

I did test this with the SKU 377 encoder and a Feather M0.

@tannewt
Copy link
Owner

tannewt commented Jun 1, 2018

This breaks pirkey

@dhalbert
Copy link
Collaborator Author

dhalbert commented Jun 1, 2018

That is weird because it compiles fine in my clone of your repo with those changes:

...
5912 bytes free in flash out of 188416 bytes ( 184.0 kb ).
4272 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Create build-pirkey_m0/firmware.bin
Create build-pirkey_m0/firmware.uf2
../../tools/uf2/utils/uf2conv.py -b 0x2000 -c -o build-pirkey_m0/firmware.uf2 build-pirkey_m0/firmware.bin
Converting to uf2, output size: 365056, start address: 0x2000
Wrote 365056 bytes to build-pirkey_m0/firmware.uf2.
halbert@salmonx:~/CP/tannewt/circuitpython/ports/atmel-samd$ git status
On branch rotaryio2

@tannewt
Copy link
Owner

tannewt commented Jun 1, 2018

Weird that its breaking will merge and make sure its fixed for the adafruit PR.

@tannewt tannewt merged this pull request into tannewt:rotaryio Jun 1, 2018
@dhalbert dhalbert deleted the rotaryio2 branch June 2, 2018 22:59
tannewt pushed a commit that referenced this pull request Aug 16, 2018
tannewt pushed a commit that referenced this pull request Oct 18, 2018
tannewt pushed a commit that referenced this pull request Nov 8, 2018
tannewt pushed a commit that referenced this pull request Dec 5, 2018
tannewt pushed a commit that referenced this pull request Dec 5, 2018
tannewt pushed a commit that referenced this pull request Jan 11, 2019
tannewt pushed a commit that referenced this pull request Jan 24, 2019
tannewt pushed a commit that referenced this pull request Mar 26, 2019
tannewt pushed a commit that referenced this pull request Nov 20, 2019
Removed robohatmm1_m0 from build.
tannewt pushed a commit that referenced this pull request Dec 18, 2019
tannewt pushed a commit that referenced this pull request Dec 26, 2019
stm32 explicitily enable/disable vbus sense, fix warning
tannewt pushed a commit that referenced this pull request Feb 12, 2020
update to adafruit master
tannewt pushed a commit that referenced this pull request Feb 20, 2020
tannewt pushed a commit that referenced this pull request Mar 13, 2020
tannewt pushed a commit that referenced this pull request Apr 29, 2020
tannewt pushed a commit that referenced this pull request May 12, 2020
tannewt pushed a commit that referenced this pull request May 13, 2020
tannewt pushed a commit that referenced this pull request Jun 9, 2020
Merge and a few final tweaks
tannewt pushed a commit that referenced this pull request Jul 29, 2020
tannewt pushed a commit that referenced this pull request Nov 11, 2020
tannewt pushed a commit that referenced this pull request Feb 13, 2021
Merge latest CircuitPython changes (6.0.0-rc.1)
tannewt pushed a commit that referenced this pull request Mar 22, 2021
update to most recent master
tannewt pushed a commit that referenced this pull request Apr 16, 2021
Merge from original repo
tannewt pushed a commit that referenced this pull request Apr 23, 2021
tannewt pushed a commit that referenced this pull request Apr 27, 2021
tannewt pushed a commit that referenced this pull request Jun 24, 2021
asan considers that memcmp(p, q, N) is permitted to access N bytes at each
of p and q, even for values of p and q that have a difference earlier.
Accessing additional values is frequently done in practice, reading 4 or
more bytes from each input at a time for efficiency, so when completing
"non_exist<TAB>" in the repl, this causes a diagnostic:

    ==16938==ERROR: AddressSanitizer: global-buffer-overflow on
    address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff
    READ of size 9 at 0x555555cd8dc8 thread T0
        #0 0x7ffff726457a  (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
        #1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301
        #2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re
        #3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513
        #4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni
        #5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/
        #6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m
        #7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308
        #8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni

    0x555555cd8dc8 is located 0 bytes to the right of global variable
    'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of
    size 8
      'import_str' is ascii string 'import '

Signed-off-by: Jeff Epler <[email protected]>
tannewt pushed a commit that referenced this pull request May 16, 2022
tannewt pushed a commit that referenced this pull request Nov 30, 2022
Typo in docs for supervisor.ticks_ms()
tannewt pushed a commit that referenced this pull request Apr 28, 2023
tannewt pushed a commit that referenced this pull request Jun 6, 2023
Board files for LOLIN S3 MINI
tannewt pushed a commit that referenced this pull request Sep 29, 2023
Add board def for MagiClick S3
tannewt pushed a commit that referenced this pull request Feb 23, 2024
tannewt pushed a commit that referenced this pull request Aug 8, 2024
Added additional pin names to pins.c for vidi_x board
tannewt pushed a commit that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants