Skip to content
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

Add animations #15

Merged
merged 5 commits into from
Aug 27, 2024
Merged

Add animations #15

merged 5 commits into from
Aug 27, 2024

Conversation

kienvo
Copy link
Member

@kienvo kienvo commented Jun 10, 2024

There are just 2 animations here as implemented for Bluetooth mode indication and splash but there will be more on this PR.

Summary by Sourcery

This pull request introduces animations for Bluetooth mode indication and splash screen, refactors framebuffer handling to bitmap handling, and implements a task management system for animations. It also updates the documentation and build configuration to support these changes.

  • New Features:
    • Introduced animations for Bluetooth mode indication and splash screen.
    • Added support for various animation modes including scroll, fixed, laser, snowflake, and picture.
  • Enhancements:
    • Refactored framebuffer (fb) handling to bitmap (bm) handling for better clarity and functionality.
    • Implemented a task management system for handling animations and button scanning.
  • Build:
    • Updated Makefile to include new source files for animations and bitmap handling.
  • Documentation:
    • Updated BadgeBLE.md to correct the animation mode descriptions.

@kienvo kienvo closed this Jun 12, 2024
@kienvo kienvo reopened this Jun 12, 2024
@mariobehling
Copy link
Member

@sourcery-ai review

Copy link

sourcery-ai bot commented Jul 22, 2024

Reviewer's Guide by Sourcery

This pull request introduces initial support for animations, including a splash screen animation and various scrolling animations. It also updates the build configuration to include new animation-related source files.

File-Level Changes

Files Changes
src/main.c
src/data.c
src/data.h
Replaced framebuffer (fb) related functions and variables with bitmap (bm) equivalents, added new functions for handling animations and bitmaps.
src/ble/peripheral.c
src/ble/setup.h
Added functions to enable and disable BLE advertising, updated BLE setup functions.
src/animation.c
src/bmlist.c
src/bmlist.h
src/animation.h
Added new files for implementing and managing animations and bitmaps.
src/fb.c
src/fb.h
Deleted old framebuffer files.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@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!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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 to tell me if it was helpful.

@@ -67,6 +69,13 @@ static void fb_transition()
{
fblist_gonext();
}
void play_splash(xbm_t *xbm, int col, int row)
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider making play_splash static.

If play_splash is only used within this file, it would be better to make it static to limit its scope and avoid potential naming conflicts.

Suggested change
void play_splash(xbm_t *xbm, int col, int row)
static void play_splash(xbm_t *xbm, int col, int row)

src/animation.h Show resolved Hide resolved
@kienvo kienvo force-pushed the animation branch 2 times, most recently from 0a659eb to 2f98dba Compare July 28, 2024 17:50
@kienvo kienvo marked this pull request as ready for review July 29, 2024 04:59
Copy link

@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 - here's some feedback:

Overall Comments:

  • Consider adding synchronization mechanisms for the shared fb array to prevent potential race conditions.
  • It might be beneficial to add a comment explaining the rationale behind the transition from the fb system to the new bmlist system.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 1 issue found

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 to tell me if it was helpful.

src/bmlist.c Show resolved Hide resolved
laser_out(bm, fb, c - LED_COLS * 2, frame);
}

static uint32_t b16dialate(uint16_t w, int from, int to)
Copy link

Choose a reason for hiding this comment

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

suggestion (performance): Optimize bit manipulation for better performance

The bit manipulation in b16dialate and similar functions could potentially be optimized. Consider using lookup tables or more efficient bit twiddling techniques to improve performance, especially important for embedded systems.

BadgeBLE.md Show resolved Hide resolved
@mariobehling mariobehling merged commit c95faf3 into fossasia:master Aug 27, 2024
1 check passed
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