-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
37 lines (30 loc) · 863 Bytes
/
main.c
File metadata and controls
37 lines (30 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <xenos/xe.h>
#include <console/console.h>
#include <debug.h>
#include <xenon_uart/xenon_uart.h>
#include <xenon_soc/xenon_power.h>
#include <time/time.h>
int main() {
// Инициализация отладки
xenon_uart_init();
console_init();
xenos_init(VIDEO_MODE_AUTO);
console_close();
// Настройка экрана
struct XenosSurface *fb = NULL;
fb = xenos_create_surface(640, 480, XE_FMT_8888 | XE_SURFACE_NO_TEXTURE);
u32 white = 0xFFFFFFFF;
u32 black = 0x00000000;
u32 *pixels = (u32 *)fb->base;
int toggle = 0;
for (;;) {
u32 color = toggle ? white : black;
for (int i = 0; i < fb->width * fb->height; i++) {
pixels[i] = color;
}
xenos_present(fb);
toggle = !toggle;
udelay(500000); // 500 мс
}
return 0;
}