void display_draw( bool sleep ) { // Turn on the busy LED: display_busy( true ); // Blank the display if requested: if ( sleep ) { u8g_SleepOn( &u8g ); } // Render the image: u8g_FirstPage( &u8g ); do { // Stop if the draw function doesn't want to continue: if ( ! ui_draw( &u8g ) ) { break; } } while ( u8g_NextPage( &u8g ) ); u8g_Delay( 100 ); // Turn the display back on if blanking was requested: if ( sleep ) { u8g_SleepOff( &u8g ); } // Turn off the busy LED: display_busy( false ); }
ICACHE_FLASH_ATTR void drawingSetShow(DrawingState *state, bool isShown) { if (isShown) u8g_SleepOn(&(state->u8g)); else u8g_SleepOff(&(state->u8g)); drawingSetInvalid(state); }
// Lua: u8g.sleepOn( self ) static int lu8g_sleepOn( lua_State *L ) { lu8g_userdata_t *lud; if ((lud = get_lud( L )) == NULL) return 0; u8g_SleepOn( LU8G ); return 0; }
void display_draw_full_screen_bitmap( const u8g_pgm_uint8_t *image ) { u8g_SleepOn( &u8g ); u8g_DrawFullScreenBitmapP( &u8g, (uint8_t *) image ); u8g_SleepOff( &u8g ); }