Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
dc4da6b0
Commit
dc4da6b0
authored
Aug 26, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lcd: Fixed off-by-one error.
parent
32dbae74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lcd.c
sw/common/drivers/lcd.c
+3
-3
No files found.
sw/common/drivers/lcd.c
View file @
dc4da6b0
...
...
@@ -251,7 +251,7 @@ void lcd_set_pixel(uint8_t x, uint8_t y, uint8_t value)
#ifdef LCD_ROTATE
uint8_t
mask
=
1
<<
(
y
&
0x07
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
-
1
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
#else
uint8_t
mask
=
1
<<
(
x
&
0x07
);
// == 1 << (x % 8)
uint16_t
offset
=
(
y
*
LCD_STRIDE
)
+
(
x
>>
3
);
// == y * LCD_STRIDE + x / 8
...
...
@@ -270,7 +270,7 @@ void lcd_toggle_pixel(uint8_t x, uint8_t y)
#ifdef LCD_ROTATE
uint8_t
mask
=
1
<<
(
y
&
0x07
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
-
1
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
#else
uint8_t
mask
=
1
<<
(
x
&
0x07
);
// == 1 << (x % 8)
uint16_t
offset
=
(
y
*
LCD_STRIDE
)
+
(
x
>>
3
);
// == y * LCD_STRIDE + x / 8
...
...
@@ -286,7 +286,7 @@ uint8_t lcd_get_pixel(uint8_t x, uint8_t y)
#ifdef LCD_ROTATE
uint8_t
mask
=
1
<<
(
y
&
0x07
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
uint16_t
offset
=
((
LCD_WIDTH
-
x
-
1
)
*
LCD_STRIDE
)
+
(
y
>>
3
);
#else
uint8_t
mask
=
1
<<
(
x
&
0x07
);
// == 1 << (x % 8)
uint16_t
offset
=
(
y
*
LCD_STRIDE
)
+
(
x
>>
3
);
// == y * LCD_STRIDE + x / 8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment