#include "draw.h"
#include <stdlib.h>
+#include <string.h>
#include "font.h"
extern uint8_t* screen_buffer;
{
switch(color) {
case c_BLACK:
- for (int i = 0; i < (hres_bytes*VRES); i++)
- screen_buffer[i] = 0;
+ clear_screen();
break;
case c_WHITE:
- for (int i = 0; i < (hres_bytes*VRES); i++)
- screen_buffer[i] = 0xFF;
+ memset( (void*)screen_buffer, 0xFF, hres_bytes*VRES );
break;
case c_INVERT:
for (int i = 0; i < (hres_bytes*VRES); i++)
screen_buffer[i] = ~screen_buffer[i];
break;
+ default:
+ memset( (void*)screen_buffer, color, hres_bytes*VRES );
+
}
}
}
}
+void clear_screen( void )
+{
+ memset( (void*)screen_buffer, 0, hres_bytes*VRES );
+}
void draw_char ( uint8_t pos_x, uint8_t pos_y, uint8_t ch);
void draw_string ( uint8_t pos_x, uint8_t pos_y, const char *text);
+void clear_screen( void );
+
#endif