Skip to content

Conversation

@juhum1
Copy link

@juhum1 juhum1 commented Nov 10, 2024

added encoder enum, ternary operators, macros (Jacob)

@jacobkoziej jacobkoziej self-requested a review November 11, 2024 22:37
@jacobkoziej jacobkoziej assigned jacobkoziej and juhum1 and unassigned jacobkoziej Nov 11, 2024
Copy link
Member

@jacobkoziej jacobkoziej left a comment

Choose a reason for hiding this comment

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

Really good changes, my only additional request is a more descriptive PR name.

Comment on lines +87 to +90
pulse_cnt[ENCODER_N] += ((CHANNEL == ENCODER_CHANNEL_A) \
^ (chan_a ^ chan_b)) \
? 1 \
: -1; \
Copy link
Member

Choose a reason for hiding this comment

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

Let's disable clang formatting for the macro definitions so that we don't have strange formatting like this.

Comment on lines 179 to 180
const uint16_t cur_pulse_cnt[ENCODER_COUNT]
= {pulse_cnt[ENCODER_LEFT], pulse_cnt[ENCODER_RIGHT]};
Copy link
Member

Choose a reason for hiding this comment

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

Let's use [INDEX] = value formatting for this array.

@juhum1 juhum1 requested a review from jacobkoziej November 15, 2024 04:51
@juhum1 juhum1 changed the title Update ctrl.c Increase readability of ctrl.c Nov 15, 2024
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.

3 participants