Skip to content

Commit 021a42e

Browse files
zelenskiCS107E BOT
authored andcommitted
A7 wip
commit c3e45209b1e2c88822748a7762fed62849c2ba48 Author: Julie Zelenski <[email protected]> Date: Tue Nov 12 16:23:07 2024 -0800 A7 wip
1 parent 1a80301 commit 021a42e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lectures/Framebuffer/code/clear/clear.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "malloc.h"
55
#include "printf.h"
66
#include "uart.h"
7+
#include "strings.h"
78

89
// module-level variables
910
static struct {
@@ -42,6 +43,7 @@ static void clear_int_by_int_green(void) {
4243
int npixels = module.width * module.height;
4344
for (int i = 0; i < npixels; i++) {
4445
*im++ = 0xff00ff00; // green
46+
timer_delay_us(1);
4547
}
4648
}
4749

@@ -68,7 +70,7 @@ void main(void) {
6870

6971
printf("Screen size %d x %d\n", hdmi_get_screen_width(), hdmi_get_screen_height());
7072
printf("Framebuffer size %d x %d\n", module.width, module.height);
71-
clear_char_by_char();
73+
// clear_char_by_char();
7274
while (1) {
7375
if (!confirm("clear to white, char by char")) break;
7476
clear_char_by_char();

lectures/Framebuffer/code/doublebuffer/hello.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
void main(void) {
66
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
88

99
printf("Enter any key to exit: ");
1010
while (!uart_haschar()) {

lectures/Interrupts1/code/button-interrupt/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void main(void) {
3131

3232
interrupts_init();
3333
gpio_interrupt_init();
34-
gpio_interrupt_config(button, GPIO_INTERRUPT_NEGATIVE_EDGE, false);
34+
gpio_interrupt_config(button, GPIO_INTERRUPT_NEGATIVE_EDGE, true);
3535
gpio_interrupt_register_handler(button, button_pressed, &button);
3636
gpio_interrupt_enable(button);
3737
interrupts_global_enable();
@@ -42,8 +42,8 @@ void main(void) {
4242
int last_count = gCount;
4343
while (1) {
4444
if (last_count != gCount) {
45-
update_screen();
4645
last_count = gCount;
46+
update_screen();
4747
console_printf("\nWaiting for button click...\n");
4848
}
4949
}

lectures/Interrupts1/code/console/console_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ extern void console_enable_blink_cursor(void);
1414
* because the screen refresh is so time consuming.
1515
*/
1616

17-
#define USE_INTERRUPTS 0
18-
17+
#define USE_INTERRUPTS 1
1918
void main(void) {
2019
gpio_init();
2120
uart_init();

0 commit comments

Comments
 (0)