d08c2860da
ysyx_22040000 李心杨 Linux calcite 6.6.19 #1-NixOS SMP PREEMPT_DYNAMIC Fri Mar 1 12:35:11 UTC 2024 x86_64 GNU/Linux 16:26:21 up 4 days 3:32, 2 users, load average: 0.85, 0.91, 0.95
32 lines
607 B
C
32 lines
607 B
C
#include <am.h>
|
|
#include <klib.h>
|
|
#include <klib-macros.h>
|
|
|
|
extern uint32_t image[][400][300];
|
|
extern uint32_t image_end[][400][300];
|
|
#define NR_IMG (image_end - image)
|
|
|
|
void display_image(int i) {
|
|
io_write(AM_GPU_FBDRAW, 0, 0, &image[i][0][0], 400, 300, true);
|
|
}
|
|
|
|
int main() {
|
|
ioe_init();
|
|
|
|
int i = 0;
|
|
unsigned long last = 0;
|
|
unsigned long current;
|
|
|
|
display_image(i);
|
|
|
|
while (1) {
|
|
current = io_read(AM_TIMER_UPTIME).us / 1000;
|
|
if (current - last > 5000) {
|
|
// change image every 5s
|
|
i = (i + 1) % NR_IMG;
|
|
display_image(i);
|
|
last = current;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|