File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 4
4
#include "malloc.h"
5
5
#include "printf.h"
6
6
#include "uart.h"
7
+ #include "strings.h"
7
8
8
9
// module-level variables
9
10
static struct {
@@ -42,6 +43,7 @@ static void clear_int_by_int_green(void) {
42
43
int npixels = module .width * module .height ;
43
44
for (int i = 0 ; i < npixels ; i ++ ) {
44
45
* im ++ = 0xff00ff00 ; // green
46
+ timer_delay_us (1 );
45
47
}
46
48
}
47
49
@@ -68,7 +70,7 @@ void main(void) {
68
70
69
71
printf ("Screen size %d x %d\n" , hdmi_get_screen_width (), hdmi_get_screen_height ());
70
72
printf ("Framebuffer size %d x %d\n" , module .width , module .height );
71
- clear_char_by_char ();
73
+ // clear_char_by_char();
72
74
while (1 ) {
73
75
if (!confirm ("clear to white, char by char" )) break ;
74
76
clear_char_by_char ();
Original file line number Diff line number Diff line change 4
4
5
5
void main (void ) {
6
6
uart_init ();
7
- gl_init (800 , 600 , GL_SINGLEBUFFER ); // change to GL_DOUBLEBUFFER instead
7
+ gl_init (800 , 600 , GL_DOUBLEBUFFER ); // change to GL_DOUBLEBUFFER instead
8
8
9
9
printf ("Enter any key to exit: " );
10
10
while (!uart_haschar ()) {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ void main(void) {
31
31
32
32
interrupts_init ();
33
33
gpio_interrupt_init ();
34
- gpio_interrupt_config (button , GPIO_INTERRUPT_NEGATIVE_EDGE , false );
34
+ gpio_interrupt_config (button , GPIO_INTERRUPT_NEGATIVE_EDGE , true );
35
35
gpio_interrupt_register_handler (button , button_pressed , & button );
36
36
gpio_interrupt_enable (button );
37
37
interrupts_global_enable ();
@@ -42,8 +42,8 @@ void main(void) {
42
42
int last_count = gCount ;
43
43
while (1 ) {
44
44
if (last_count != gCount ) {
45
- update_screen ();
46
45
last_count = gCount ;
46
+ update_screen ();
47
47
console_printf ("\nWaiting for button click...\n" );
48
48
}
49
49
}
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ extern void console_enable_blink_cursor(void);
14
14
* because the screen refresh is so time consuming.
15
15
*/
16
16
17
- #define USE_INTERRUPTS 0
18
-
17
+ #define USE_INTERRUPTS 1
19
18
void main (void ) {
20
19
gpio_init ();
21
20
uart_init ();
You can’t perform that action at this time.
0 commit comments