mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 23:39:29 -05:00
Function to read bytes from 16-bit LCD interface.
...begin careful not to overread from the LCD, or overwrite to the buffer.
This commit is contained in:
parent
1f79c72bf0
commit
6d0995e165
@ -152,6 +152,20 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_read_bytes(uint8_t* byte, size_t byte_count) {
|
||||
size_t word_count = byte_count / 2;
|
||||
while(word_count) {
|
||||
const auto word = lcd_read_data_frame_memory();
|
||||
*(byte++) = word >> 8;
|
||||
*(byte++) = word >> 0;
|
||||
word_count--;
|
||||
}
|
||||
if( byte_count & 1 ) {
|
||||
const auto word = lcd_read_data_frame_memory();
|
||||
*(byte++) = word >> 8;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t io_read() {
|
||||
io_stb_assert();
|
||||
dir_read();
|
||||
|
Loading…
Reference in New Issue
Block a user