Created
December 20, 2014 07:36
-
-
Save kcbanner/7fde86be9060fb1864ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <stdint.h> | |
uint16_t *fb = (void*)0x6000000; | |
const int xsz = 240; | |
const int ysz = 160; | |
#define FRAME_SEL_BIT 0x10 | |
#define BG2_ENABLE 0x400 | |
int main(void) { | |
int i; | |
static volatile uint16_t * const reg_disp_ctl = (void*)0x4000000; | |
*reg_disp_ctl = 3 | BG2_ENABLE; | |
*reg_disp_ctl &= ~FRAME_SEL_BIT; | |
for(i = 0; i < xsz * ysz; i++) { | |
fb[i] = 31; | |
} | |
for(;;); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment