Skip to content

Conversation

kienvo
Copy link
Member

@kienvo kienvo commented Jul 23, 2025

Fixes #100

Summary by Sourcery

Make the LED refresh rate compile-time configurable by introducing a new Makefile variable and updating timer initialization to use it

Enhancements:

  • Allow custom LED refresh rate via a new LED_REFRESH_RATE variable (default 2000 Hz)
  • Update TMR0_TimerInit in main.c to derive its interval from LED_REFRESH_RATE instead of a hardcoded value

Build:

  • Define LED_REFRESH_RATE in the Makefile and propagate it to CFLAGS

Copy link
Contributor

sourcery-ai bot commented Jul 23, 2025

Reviewer's Guide

Externalizes LED refresh rate into a configurable Makefile variable (LED_REFRESH_RATE) and updates code to use this macro instead of a hardcoded value.

Class diagram for configurable LED refresh rate

classDiagram
    class main {
        +int main()
    }
    main : +TMR0_TimerInit((FREQ_SYS / LED_REFRESH_RATE) / 2)
    main : +uses LED_REFRESH_RATE macro
Loading

File-Level Changes

Change Details Files
Introduce and propagate LED_REFRESH_RATE build variable
  • Add LED_REFRESH_RATE definition with default value
  • Include LED_REFRESH_RATE in CFLAGS via -DLED_REFRESH_RATE
Makefile
Use LED_REFRESH_RATE macro in timer initialization
  • Replace hardcoded 2000 Hz value with LED_REFRESH_RATE in TMR0_TimerInit call
src/main.c

Assessment against linked issues

Issue Objective Addressed Explanation
#100 Increase the LED refresh rate to reduce or eliminate visible flickering at maximum brightness.
#100 Make the LED refresh rate configurable to allow tuning for maximum technical capability of the board.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @kienvo - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@froscon2024
Copy link
Contributor

froscon2024 commented Aug 25, 2025

Are there some tests done to know what is the highest possible refresh rate?

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.

Refresh rate to low
2 participants