warning-free compile

This commit is contained in:
Philippe G
2020-08-12 16:10:18 -07:00
parent 089c856df3
commit c01a83b466
19 changed files with 117 additions and 99 deletions

View File

@@ -168,7 +168,7 @@ static void Update1( struct GDS_Device* Device ) {
}
// in 1 bit mode, SSD1326 has a different memory map than SSD1306 and SH1106
static void IRAM_ATTR DrawPixel1FastLocal( struct GDS_Device* Device, int X, int Y, int Color ) {
static void IRAM_ATTR _DrawPixel1Fast( struct GDS_Device* Device, int X, int Y, int Color ) {
uint32_t XBit = ( X & 0x07 );
uint8_t* FBOffset = Device->Framebuffer + ( ( Y * Device->Width + X ) >> 3 );
@@ -188,12 +188,12 @@ static void ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int
for (int r = y1; r <= y2; r++) {
int c = x1;
// for a row that is not on a boundary, not column opt can be done, so handle all columns on that line
while (c & 0x07 && c <= x2) DrawPixel1FastLocal( Device, c++, r, Color );
while (c & 0x07 && c <= x2) _DrawPixel1Fast( Device, c++, r, Color );
// at this point we are aligned on column boundary
int chunk = (x2 - c + 1) >> 3;
memset(optr + Width * r + (c >> 3), _Color, chunk );
c += chunk * 8;
while (c <= x2) DrawPixel1FastLocal( Device, c++, r, Color );
while (c <= x2) _DrawPixel1Fast( Device, c++, r, Color );
}
}
@@ -320,7 +320,7 @@ static const struct GDS_Device SSD132x = {
struct GDS_Device* SSD132x_Detect(char *Driver, struct GDS_Device* Device) {
uint8_t Model;
int Depth;
if (strcasestr(Driver, "SSD1326")) Model = SSD1326;
else if (strcasestr(Driver, "SSD1327")) Model = SSD1327;
else return NULL;
@@ -328,13 +328,14 @@ struct GDS_Device* SSD132x_Detect(char *Driver, struct GDS_Device* Device) {
if (!Device) Device = calloc(1, sizeof(struct GDS_Device));
*Device = SSD132x;
((struct PrivateSpace*) Device->Private)->Model = Model;
struct PrivateSpace *Private = (struct PrivateSpace*) Device->Private;
Private->Model = Model;
sscanf(Driver, "%*[^:]:%u", &Depth);
if (Model == SSD1326 && Depth == 1) {
Device->Update = Update1;
Device->DrawPixelFast = DrawPixel1FastLocal;
Device->DrawPixelFast = _DrawPixel1Fast;
Device->DrawBitmapCBR = DrawBitmapCBR;
Device->ClearWindow = ClearWindow;
Device->Depth = 1;

View File

@@ -118,7 +118,7 @@ static void Update( struct GDS_Device* Device ) {
}
// remember that for these ELD drivers W and H are "inverted"
static inline void DrawPixelLocal( struct GDS_Device* Device, int X, int Y, int Color ) {
static inline void _DrawPixel( struct GDS_Device* Device, int X, int Y, int Color ) {
uint32_t YBit = ( Y & 0x07 );
Y>>= 3;
@@ -129,7 +129,7 @@ static inline void DrawPixelLocal( struct GDS_Device* Device, int X, int Y, int
static void ClearWindow( struct GDS_Device* Device, int x1, int y1, int x2, int y2, int Color ) {
for (int r = y1; r <= y2; r++) {
for (int c = x1; c <= x2; c++) {
DrawPixelLocal( Device, c, r, Color );
_DrawPixel( Device, c, r, Color );
}
}
}
@@ -228,7 +228,7 @@ static bool Init( struct GDS_Device* Device ) {
static const struct GDS_Device SSD1675 = {
.DrawBitmapCBR = DrawBitmapCBR, .ClearWindow = ClearWindow,
.DrawPixelFast = DrawPixelLocal,
.DrawPixelFast = _DrawPixel,
.Update = Update, .Init = Init,
.Mode = GDS_MONO, .Depth = 1,
.Alloc = GDS_ALLOC_NONE,

View File

@@ -282,8 +282,9 @@ struct GDS_Device* ST77xx_Detect(char *Driver, struct GDS_Device* Device) {
if (!Device) Device = calloc(1, sizeof(struct GDS_Device));
*Device = ST77xx;
((struct PrivateSpace*) Device->Private)->Model = Model;
sscanf(Driver, "%*[^:]:%u", &Depth);
struct PrivateSpace* Private = (struct PrivateSpace*) Device->Private;
Private->Model = Model;
if (Depth == 18) {
Device->Mode = GDS_RGB666;

View File

@@ -384,7 +384,11 @@ void displayer_control(enum displayer_cmd_e cmd, ...) {
bool display_is_valid_driver(char * driver){
return display_conf_get_driver_name(driver)!=NULL;
}
char * display_conf_get_driver_name(char * driver){
/****************************************************************************************
*
*/
const char *display_conf_get_driver_name(char * driver){
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
if(strcasestr(driver,known_drivers[i])){
return known_drivers[i];

View File

@@ -31,7 +31,7 @@ enum displayer_time_e { DISPLAYER_ELAPSED, DISPLAYER_REMAINING };
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
char * display_conf_get_driver_name(char * driver);
const char *display_conf_get_driver_name(char * driver);
bool display_is_valid_driver(char * driver);
void displayer_scroll(char *string, int speed, int pause);