efthymios-ks / avr-ssd1306 Goto Github PK
View Code? Open in Web Editor NEWSSD1306-based GLCD C library for AVR microcontrollers
License: MIT License
SSD1306-based GLCD C library for AVR microcontrollers
License: MIT License
Hello,
I have a simple program that uses your library. It makes it very simple to display text and basic shapes, thank you for contributing this. Every once in a while it seems something writes all over the memory of my application with values like 0xff or 0x00.
I have some code that adjusts my internally managed X and Y offsets on a timer. So the displayed image is shifted by a few pixels all over the screen very slowly. This is meant to avoid burn in of the display.
I have been trying to understand this problem and was doing some basic code review of your code and noticed what seems like an error in your Y Axis bounds checking
void GLCD_GotoX(const uint8_t X)
{
if (X < __GLCD_Screen_Width)
__GLCD.X = X;
}
void GLCD_GotoY(const uint8_t Y)
{
if (__GLCD.Y < __GLCD_Screen_Height)
__GLCD.Y = Y;
}
My screen height and width are less than 255.
If I make a call like GLCD_GotoX(255)
it will just do nothing.
But I call GLCD_GotoY(255)
the first call checks the existing value __GLCD.Y
against the maximum height. It then sets __GLCD.Y = 255
. Now __GLCD.Y
is stuck at too large of a value. Presumably now the graphics library is just writing all over the SRAM of my device.
I think the check in GLCD_GotoY
should be if ( Y < __GLCD_ScreenHeight)
. Do you agree?
Eric
On SSD1396.c, getting warning in Microchip Studio 7, "extra tokens at end of #ifdef directive" on line 41
On SSD1396.c, getting error in Microchip Studio 7, "missing binary operator before token "("" on line 107
On TWI.c, getting error in Microchip Studio 7, "'F_CPU' undeclared (first use in this function)" on line 23
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.