-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: Charging status #50
Conversation
Why did you add the coffee cup again? Yes, it was there before in the closed source firmware, but is the coffee cup something that should be there? Did you liked the design of the coffee cup? Also one thing i did not liked in the closed source firmware was that it was not possible to charge the badge and still use it. I had either the tag-info without charger attached or coffee cup when charger attached. |
- add 5x7 font - add animation - display version after the animation end - add BOOT state for switching to normal mode while charging
313aced
to
907bf59
Compare
The coffee cup was added because of my laziness. I had no idea instead of just made it like the closed firmware. Now removed. Placing the firmware version next to the battery symbol is a good idea. I've just added an animation that displays "FOSSASIA" -> "Badge Magic" -> version. The version number will automated in #53. My badge comes with closed firmware that can be used while charging, by pressing the KEY2. Seem like your badge has a different firmware. |
Reviewer's Guide by SourceryThis pull request implements a charging status feature for the device. It adds functionality to display battery status, detect charging, and show a boot animation. The changes primarily affect the main program flow, add new display functions, and introduce battery-related calculations. Sequence DiagramsequenceDiagram
participant Main
participant ChargingStatus
participant Display
participant Battery
Main->>ChargingStatus: disp_charging()
loop While in BOOT mode
ChargingStatus->>Battery: read_batt_raw()
Battery-->>ChargingStatus: battery raw value
ChargingStatus->>Battery: bat_raw2percent()
Battery-->>ChargingStatus: battery percentage
ChargingStatus->>ChargingStatus: is_charging()
alt Is Charging
ChargingStatus->>Display: Show charging animation
ChargingStatus->>Display: Show battery percentage
else Not Charging
ChargingStatus->>Display: Show static battery status
ChargingStatus->>Main: Return to main loop
end
end
Main->>Main: Continue with normal operation
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -0,0 +1,100 @@ | |||
#include <stdint.h> | |||
|
|||
uint8_t font5x7[][6] = { //Font 5x7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Add a comment explaining the structure of the font array
A brief comment explaining how the bit patterns in the array correspond to character shapes would improve the readability and maintainability of this code.
// Font 5x7: Each character is represented by 6 bytes
// The first 5 bytes define the 5x7 pixel grid (columns)
// The 6th byte is always 0x00 (for spacing)
// 1 in a bit position means pixel on, 0 means pixel off
uint8_t font5x7[][6] = { //Font 5x7
Can't we just make simple things ? |
Having the firmware version somewhere visible for a normal user without the need of additional hardware to read out would be beneficial. In general people always have devices these days that report a firmware version. |
Resolves #39.
Summary by Sourcery
Implement a charging status feature that includes battery level detection and display, along with a new font rendering capability for text display on the device.
New Features:
Enhancements: