aboutsummaryrefslogtreecommitdiffstats
path: root/src/display_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/display_draw.c')
-rw-r--r--src/display_draw.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/display_draw.c b/src/display_draw.c
index a315bf7..62578e3 100644
--- a/src/display_draw.c
+++ b/src/display_draw.c
@@ -100,6 +100,15 @@ void dsp_rect(int x, int y, int w, int h, uint16_t color)
UNLOCK;
}
+void dsp_pixel(int x, int y, uint16_t color)
+{
+ LOCK;
+ dsp_set_addr(x, y, x, y);
+ dsp_write_data(color >> 8);
+ dsp_write_data(color & 0xFF);
+ UNLOCK;
+}
+
void dsp_line(int x, int y, int i, int j, uint16_t color)
{
int dx = i - x;
@@ -115,11 +124,7 @@ void dsp_line(int x, int y, int i, int j, uint16_t color)
int e2;
while (1) {
- LOCK;
- dsp_set_addr(x, y, x, y);
- dsp_write_data(color >> 8);
- dsp_write_data(color & 0xFF);
- UNLOCK;
+ dsp_pixel(x, y, color);
if (x == i && y == j)
break;
e2 = err;