Skip to content

Quad encoder#15

Merged
rtyocum merged 15 commits into
mainfrom
quad-encoder
Mar 30, 2026
Merged

Quad encoder#15
rtyocum merged 15 commits into
mainfrom
quad-encoder

Conversation

@infinityspike

Copy link
Copy Markdown
Contributor

Description

Pulse counter library complete, tests pass. Accumulation works, axis 5 was manually spun past the signed 16bit value (32767) and the count just went straight past.

Metrics

  • PR Confidence value(1 ~ 5): 5

@infinityspike infinityspike requested review from frey808 and rtyocum March 4, 2026 22:09
@infinityspike infinityspike self-assigned this Mar 4, 2026
@infinityspike infinityspike linked an issue Mar 4, 2026 that may be closed by this pull request

@rtyocum rtyocum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of it looks good, just a few small things.

Comment thread components/encoder/test/test_encoder.c
Comment thread components/encoder/test/test_encoder.c

ESP_LOGI(TAG, "add limit watch points for count accumulation");
int watch_points[] = {ENCODER_LOW_LIMIT, ENCODER_HIGH_LIMIT};
for (size_t i = 0; i < sizeof(watch_points) / sizeof(watch_points[0]); i++) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a loop for 2 watch points

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an artifact for the handy example code, it allows for more watch points in the future if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

Comment thread components/encoder/encoder.c
Comment thread test/main/esp_driver_test.c Outdated
@@ -0,0 +1,56 @@
menu "Encoder Configuration"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this a config and pass it into the encoder? This module needs to be reusable, as we're gonna have a bunch of encoders and rn this only works for one it looks like. Also half of these aren't used other than in the tests. If thats the case move them to the test/Kconfig not here

I think pretty much every config in here should be passed in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be resolved? If so close it

@frey808 frey808 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good aside from what ryan pointed out


ESP_LOGI(TAG, "add limit watch points for count accumulation");
int watch_points[] = {ENCODER_LOW_LIMIT, ENCODER_HIGH_LIMIT};
for (size_t i = 0; i < sizeof(watch_points) / sizeof(watch_points[0]); i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

@rtyocum rtyocum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works,and comments are resolved

@rtyocum rtyocum merged commit dd96b3e into main Mar 30, 2026
1 check passed
@rtyocum rtyocum deleted the quad-encoder branch March 30, 2026 15:36
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.

ESP PCNT

3 participants