Remove backlight control from anywhere except platform.c and platform.h

replace/1c9a4724897faf4e77c1420ba5e0dd5a6f2782d4
Federico Amedeo Izzo 2020-10-22 20:21:10 +02:00 zatwierdzone przez Niccolò Izzo
rodzic c77ff5b339
commit c3ef0ca036
4 zmienionych plików z 9 dodań i 23 usunięć

Wyświetl plik

@ -44,13 +44,12 @@
*/
/**
* This function initialises the display, configures backlight control and
* allocates framebuffer on the heap. After initialisation, backlight is set
* to zero.
* This function initialises the display and allocates framebuffer on the heap.
*
* NOTE: framebuffer allocation is the first operation performed, if fails an
* error message is printed on the virtual COM port and this function returns
* prematurely, without configuring the display and the backlight timer. Thus, a
* dark screen can be symptom of failed allocation.
* prematurely, without configuring the display.
* Thus, a dark screen can be symptom of failed allocation.
*/
void display_init();
@ -70,7 +69,7 @@ void display_init();
void *display_getFrameBuffer();
/**
* When called, this function turns off backlight, shuts down backlight control
* When called, this function terminates the display driver
* and deallocates the framebuffer.
*/
void display_terminate();

Wyświetl plik

@ -29,7 +29,7 @@
* This interface is based on the lower level interface display.h
* Many methods of graphics.h are basically calls to methods in display.h.
*
* On top of basic framebuffer and backlight control, graphics.h implements
* On top of basic framebuffer control, graphics.h implements
* graphics primitives for drawing fonts and shapes
*
*********************** HOW TO MANAGE FRAMEBUFFER *****************************
@ -88,13 +88,13 @@ typedef enum
/**
* This function calls the correspondent method of the low level interface display.h
* It initializes the display and sets the backlight to zero.
* It initializes the display.
*/
void gfx_init();
/**
* This function calls the correspondent method of the low level interface display.h
* It turns off backlight, shuts down backlight control and deallocates the framebuffer.
* It terminates the display driver and deallocates the framebuffer.
*/
void gfx_terminate();
@ -112,14 +112,6 @@ uint16_t gfx_screenWidth();
*/
uint16_t gfx_screenHeight();
/**
* This function calls the correspondent method of the low level interface display.h
* Set screen backlight to a given level.
* @param level: backlight level, from 0 (backlight off) to 255 (backlight at
* full brightness).
*/
void gfx_setBacklightLevel(uint8_t level);
/**
* This function calls the correspondent method of the low level interface display.h
* Copy a given section, between two given rows, of framebuffer content to the

Wyświetl plik

@ -342,7 +342,7 @@ void display_init()
void display_terminate()
{
/* Shut off backlight, FSMC and deallocate framebuffer */
/* Shut off FSMC and deallocate framebuffer */
gpio_setMode(GPIOC, 6, OUTPUT);
gpio_clearPin(GPIOC, 6);
RCC->AHB3ENR &= ~RCC_AHB3ENR_FSMCEN;

Wyświetl plik

@ -185,11 +185,6 @@ uint16_t display_screenHeight()
return SCREEN_HEIGHT;
}
void display_setBacklightLevel(uint8_t level)
{
printf("Backlight level set to %d\n", level);
}
void display_renderRows(uint8_t startRow, uint8_t endRow)
{
Uint32 *pixels = (Uint32*)renderSurface->pixels;