Add some comments.

This commit is contained in:
JohannesWilde 2019-09-08 11:58:46 +02:00
parent 1bce3f371c
commit a0ed1d9f85
1 changed files with 7 additions and 0 deletions

View File

@ -104,11 +104,15 @@ void u8g2_SetBufferCurrTileRow(u8g2_t *u8g2, uint8_t row)
u8g2->cb->update_page_win(u8g2);
}
/* Calculates the first row of the specified page - does not detect overflows
* or pages out of scope for the current display. */
uint8_t u8g2_PageFirstRow(u8g2_t const * const u8g2, uint8_t const page)
{
return u8g2->tile_buf_height * page;
}
/* Sets the current buffer to the page specified.
* Returns 0 in case the page is invalid - otherwise 1. */
uint8_t u8g2_CustomPage(u8g2_t * const u8g2, uint8_t const page)
{
uint8_t const row = u8g2_PageFirstRow(u8g2, page);
@ -127,6 +131,7 @@ uint8_t u8g2_CustomPage(u8g2_t * const u8g2, uint8_t const page)
}
}
/* Specialization [faster!] for setting the current buffer to the first page. */
void u8g2_FirstPage(u8g2_t *u8g2)
{
if ( u8g2->is_auto_page_clear )
@ -136,6 +141,8 @@ void u8g2_FirstPage(u8g2_t *u8g2)
u8g2_SetBufferCurrTileRow(u8g2, 0);
}
/* Sends the current buffer to the display and attempts to set the buffer to the next page.
* Returns 0 in case the next page is invalid - otherwise 1 */
uint8_t u8g2_NextPage(u8g2_t *u8g2)
{
uint8_t row;