Skip to content

initial commit for encoder driver - #8

Open
rootrc wants to merge 3 commits into
mainfrom
FW-426-encoder-driver
Open

initial commit for encoder driver#8
rootrc wants to merge 3 commits into
mainfrom
FW-426-encoder-driver

Conversation

@rootrc

@rootrc rootrc commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@rootrc rootrc self-assigned this Nov 26, 2025
Comment thread drivers/inc/encoder.h Outdated

#define DEBOUNCE_DELAY_MS 20

typedef enum {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can just use boolean.

Comment thread drivers/src/encoder.c Outdated
void encoder_run() {
static uint8_t last_state = 0;

uint8_t A = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_3) ? 1 : 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No ternaries pls.

Comment thread drivers/src/encoder.c Outdated

void EXTI15_10_IRQHandler() { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); }

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This slimes other GPIO callbacks I think. Just call irq handler directly in above function instead.

@rootrc
rootrc requested a review from lorenzogood November 29, 2025 02:54
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