-
Notifications
You must be signed in to change notification settings - Fork 36
implement display rotation #18
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
base: main
Are you sure you want to change the base?
Conversation
|
wait, something went wrong with my git here, this is not the proper commit |
807cf2e to
cbfa5c2
Compare
|
so, this should be the correct version |
|
wow, it still wasn't the correct version, how emberassing. Now I double checked and tested it. |
|
Sorry, I totally forgot you! I will check this out tomorrow. |
Any plans to merge this? It would be very helpful for my project. :) |
| memset(p->buffer, 0, p->bufsize); | ||
| } | ||
|
|
||
| inline void ssd1306_set_rotation(ssd1306_t *p, rotation_t rotation) { |
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.
in the header this is defined as a standard void but here it's inline. if you want it to be inline, just define it as a static inline in the header.
| p->rotation = rotation; | ||
| } | ||
|
|
||
| void rotate_coordinates(ssd1306_t *p, uint32_t* x, uint32_t* y) { |
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.
shouldn't this be inline?
|
|
||
| void rotate_coordinates(ssd1306_t *p, uint32_t* x, uint32_t* y) { | ||
| uint32_t tmp_x = *x; | ||
| if(p->rotation == ROT_90) { |
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.
switch case instead of if/else?
Fixes #17
Adds a
rotationattribute tossd1306_tthat can be set viassd1306_set_rotationto change the orientation of any further draw requests. Note thatwidthandheightstill correspond to the original orientation.