-
Notifications
You must be signed in to change notification settings - Fork 20
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
Optimization of OLED graphic display module with SSD1306 controller #44
base: master
Are you sure you want to change the base?
Optimization of OLED graphic display module with SSD1306 controller #44
Conversation
oleksii-kogutenko
commented
Nov 29, 2017
•
edited
Loading
edited
- update Makefile (compile analog clock with all target)
- use compatible am335x-bone-common.dtsi with mpu6050
- add i2c1 support added to dtsi
- move defines to header file
- optimization screen updater:
- use "page addressing mode" for memory mode
- send only modyfied bytes over i2c
- decreased time of writing from 6 jiff items to {0-1} jiff items
5785feb
to
c264e2e
Compare
* update Makefile * use compatible am335x-bone-common.dtsi with mpu6050 * add i2c1 support added to dtsi * move defines to header file * optimization screen updater: - use "page addressing mode" for memory mode - send only modyfied bytes over i2c
c264e2e
to
a13a50f
Compare
Debugs from optimization log: |
{ | ||
u8 type; | ||
u8 data[LCD_WIDTH * LCD_HEIGHT / 8]; | ||
} ssd1306_data_array; |
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.
Is it intended to be used in external modules?
size_t count, loff_t *ppos); | ||
static int ssd1307fb_blank(int blank_mode, struct fb_info *info); | ||
static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); | ||
static void ssd1307fb_copyarea(struct fb_info *info, const struct fb_copyarea *area); |
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.
+static int ssd1307fb_blank(int blank_mode, struct fb_info *info); +static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); +static void ssd1307fb_copyarea(struct fb_info *info, const struct fb_copyarea *area); +static void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *image);
static in the header file? what for?
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.
Please fix checkpatch issues and make some clean up
if( (draw_x1>=0)&&(draw_y1>=0) ){ | ||
Graphic_setPoint(draw_x1, draw_y1); | ||
} | ||
if( (draw_x2<=127)&&(draw_y2<=63) ){ |
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.
Aren't you confused with these "magic numbers"?
if( 0 == r) | ||
return; | ||
|
||
// calculate 8 special point(0��45��90��135��180��225��270degree) display them |
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.
Please make a clean up - remove unnesessary comments/lines
* __u16 capabilities; // see FB_CAP_* | ||
* __u16 reserved[2]; // Reserved for future compatibility | ||
* }; | ||
* */ |
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.
I believe this large bunch of dead code is unnesessary and could be deleted
/* ****************************************************************** | ||
* | ||
* *****************************************************************/ | ||
int ssd1306_UpdateScreen_old(struct ssd1306_data *drv_data) |
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.
Looks like this function is redunant
} | ||
|
||
//ssd1306_sendDataArea(drv_client, dataArray.data, sizeof(dataArray.data), 0); | ||
//memcpy(&dataArray_lcd, &dataArray, sizeof(dataArray)); |
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.
if possible -please fix checkpatch issues and remove unnesessary comments
} | ||
|
||
diff = get_jiffies_64() - jiff; | ||
pr_info ("diff: %lld\n", diff); ///diff: 6 |
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.
I think time consumption could be hidden into debug defines
ssd1306_first_start++; | ||
} else { | ||
while (cur_pos < msize) { | ||
while (cur_pos < msize && dataArray.data[cur_pos] == dataArray_lcd.data[cur_pos]) |
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.
Good point to calculate positions in buffer to update!