Commit ef5bbf07767dea77267a39f4281bebdb85b6aac4
1 parent
31093b73
Automatic BMP generation
Home screen improved
Showing
4 changed files
with
22 additions
and
3 deletions
Show diff stats
Makefile
... | ... | @@ -4,10 +4,25 @@ CC_LIBS=-pthread -lusb-1.0 |
4 | 4 | INCLUDES= |
5 | 5 | |
6 | 6 | SOURCES=main.c printx.c ui.c serial.c nfc.c bus.c hvc.c heat.c pump.c usb.c |
7 | +BMP=img/home.bmp | |
8 | +MAP_SRC= | |
7 | 9 | OBJECTS=$(SOURCES:.c=.o) |
10 | +BMPR=$(BMP:.bmp=.bmpr) | |
11 | +RGB=$(BMPR:.bmpr=.rgb) | |
12 | +MAP=$(MAP_SRC:.bmp=.map) | |
13 | +BOZ=$(RGB:.rgb=.boz) | |
8 | 14 | OUTPUT=tweekd |
9 | 15 | |
10 | -all: $(SOURCES) $(OUTPUT) | |
16 | +all: $(SOURCES) $(BOZ) $(OUTPUT) | |
17 | + | |
18 | +$(BMPR): $(BMP) | |
19 | + convert -flip $< $@ | |
20 | + | |
21 | +$(RGB): $(BMPR) | |
22 | + bmp2rgb565 $< $@ | |
23 | + | |
24 | +$(BOZ): $(RGB) $(MAP) | |
25 | + cat $< > $@ | |
11 | 26 | |
12 | 27 | $(OUTPUT): $(OBJECTS) |
13 | 28 | $(CC) $(OBJECTS) $(CC_LIBS) -o $@ |
... | ... | @@ -16,4 +31,4 @@ $(OUTPUT): $(OBJECTS) |
16 | 31 | $(CC) $(INCLUDES) $(CC_FLAGS) $< -o $@ |
17 | 32 | |
18 | 33 | clear: |
19 | - rm -f $(OUTPUT) $(OBJECTS) | |
34 | + rm -f $(OUTPUT) $(OBJECTS) $(BOZ) $(BMPR) $(MAP) $(RGB) | ... | ... |
img/home.bmp
No preview for this file type
img/home.xcf
No preview for this file type
... | ... | @@ -166,7 +166,11 @@ bool initUSB(void) |
166 | 166 | |
167 | 167 | libusb_free_config_descriptor(dConfig); |
168 | 168 | |
169 | - displayPicture("home.rgb"); | |
169 | + unsigned char data[] = {0x81, 0x00, 0x00}; | |
170 | + int transfered; | |
171 | + libusb_bulk_transfer(screenHandle, ENDPOINT_OUT, data, 3, &transfered, 0); | |
172 | + | |
173 | + displayPicture("img/home.boz"); | |
170 | 174 | |
171 | 175 | return true; |
172 | 176 | } | ... | ... |