Created
February 6, 2014 12:22
-
-
Save RaD/8843169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Buffer visualisation thread. | |
*/ | |
static WORKING_AREA(visual_wa, 128); | |
static msg_t visual(void *arg) { | |
(void) arg; | |
uint8_t col = 0; | |
chRegSetThreadName("display_refresh"); | |
palWriteGroup(GPIOA, 0b11111111, 0, 0b00000000); | |
while (!chThdShouldTerminate()) { | |
palClearPad(GPIOA, col); // cols | |
col = (col + 1) % DISPLAY_COLUMNS; | |
chMtxLock(&mtx_page); | |
PAGE* page = &pages[current_page]; | |
palWriteGroup(GPIOB, 0b11111111, 8, page->columns[col]); | |
chMtxUnlock(); | |
palSetPad(GPIOA, col); // cols | |
chThdSleepMilliseconds(3); // brightness | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment