PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Social
libbadgetools
oled_point.c
1
#include <stdlib.h>
2
#include <propeller.h>
3
#include "
badgetools.h
"
4
5
volatile
screen
*
self
;
6
7
void
point
(int32_t
x
, int32_t y, int32_t color)
8
{
9
//while(lockset(screenLock));
11
// Plot a point x,y on the screen. color is really just on or off (1 or 0)
12
x
=
x
& 0x7f;
13
if
((y > 0) && (y < self->displayHeight)) {
14
if
(color ==
SCR_WHITE
) {
15
self
->buffer[(
x
+ ((Shr__(y, 3)) * 128))] = self->buffer[(
x
+ ((Shr__(y, 3)) * 128))] | ((1<<(y % 8)));
16
}
else
{
17
// Clear the bit and it's off (black)
18
self
->buffer[(
x
+ ((Shr__(y, 3)) * 128))] = self->buffer[(
x
+ ((Shr__(y, 3)) * 128))] & (~((1<<(y % 8))));
19
}
20
}
21
if
(self->AutoUpdate)
screen_update
();
22
//lockclr(screenLock);
23
}
24
25
/*
26
TERMS OF USE: MIT License
27
28
Permission is hereby granted, free of charge, to any person obtaining a
29
copy of this software and associated documentation files (the "Software"),
30
to deal in the Software without restriction, including without limitation
31
the rights to use, copy, modify, merge, publish, distribute, sublicense,
32
and/or sell copies of the Software, and to permit persons to whom the
33
Software is furnished to do so, subject to the following conditions:
34
35
The above copyright notice and this permission notice shall be included in
36
all copies or substantial portions of the Software.
37
38
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44
DEALINGS IN THE SOFTWARE.
45
*/
46
point
void point(int x, int y, int color)
Plot a point on the oLED screen.
SCR_WHITE
#define SCR_WHITE
Sets an oLED screen pixel to white. Example: point(100, 50, SCR_WHITE) sets a pixel 100 from the righ...
Definition:
badgetools.h:175
x
int x
Definition:
07 Box and Lines.c:13
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
screen_update
int screen_update(void)
Manually update the screen image after. Typically used after multiple oLED function calls after scree...
Definition:
oled_asmfast.c:426
screen
Definition:
badgetools.h:1709
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17