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 line handling in fb_printStr #196

Merged
merged 9 commits into from
Dec 28, 2023
Merged

Add line handling in fb_printStr #196

merged 9 commits into from
Dec 28, 2023

Conversation

dreamos82
Copy link
Owner

@dreamos82 dreamos82 commented Dec 18, 2023

Close #92

void _fb_printStr( const char *string, uint32_t fg, uint32_t bg ) {
_fb_printStrAt(string, 0, cur_fb_line, fg, bg);
cur_fb_line++;
if ( cur_fb_line > framebuffer_data.number_of_lines ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldnt this be >=?

@@ -74,15 +74,16 @@ void logline(log_level_t level, const char* msg){
fbCurrentLine++;
}
else {
_fb_printStr(logLevelStrings[level], 0, fbCurrentLine, 0xFFFFFFFF, 0);
_fb_printStr(msg, logLevelStrLen, fbCurrentLine, 0xFFFFFFFF, 0);
//TODO: fbCurrentLine should be aligned with cur_fbLine in the framebuffer case.
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm yeah, this is an interesting one - I remember doing that because there no state tracking a current line number for the terminal output.
Now that the framebuffer keeps track of that itself, fbCurrentLine can be removed I reckon, and just use the new codepath. Log messages will work nicely with other things that print directly to the framebuffer now too.

@DeanoBurrito DeanoBurrito merged commit e641c2b into master Dec 28, 2023
3 checks passed
@DeanoBurrito DeanoBurrito deleted the 92_fb_line_track branch December 28, 2023 12:14
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.

framebuffer printing string should keep track of the current line
2 participants