avr-firmwares/drivers/fbani_starhopper.c

22 lines
573 B
C
Raw Normal View History

2018-10-03 22:20:35 +02:00
#include <util/delay.h>
#include "framebuffer.h"
#define HALFW (FB_WIDTH/2)
#define HALFH (FB_HEIGHT/2)
void fbani_starhopper_print_rectangles(uint8_t v) {
fb_area(0 ,0 ,HALFW ,HALFH , (v >> 3) & 1);
fb_area(HALFW,0 ,2*HALFW,HALFH , (v >> 2) & 1);
fb_area(0 ,HALFH,HALFW ,2*HALFH, (v >> 1) & 1);
fb_area(HALFW,HALFH,2*HALFW,2*HALFH, (v ) & 1);
}
void fbani_starhopper(uint16_t count) {
while(count--) {
fbani_starhopper_print_rectangles(0x0e);
_delay_ms(600);
fbani_starhopper_print_rectangles(0x0b);
_delay_ms(150);
};
}