Bigger screens preparation
This commit is contained in:
+24
-19
@@ -341,6 +341,7 @@ endif
|
|||||||
|
|
||||||
IMG2LBM = -$(PYTHON) ../util/img2lbm.py
|
IMG2LBM = -$(PYTHON) ../util/img2lbm.py
|
||||||
BIN2LBM = -$(PYTHON) ../util/bin2lbm.py
|
BIN2LBM = -$(PYTHON) ../util/bin2lbm.py
|
||||||
|
FONT2PNG = -$(PYTHON) ../util/font2png.py
|
||||||
TRANSLATE = -$(PYTHON) ../util/translate.py
|
TRANSLATE = -$(PYTHON) ../util/translate.py
|
||||||
VERSION = 2.0.99
|
VERSION = 2.0.99
|
||||||
|
|
||||||
@@ -367,6 +368,7 @@ EEPROM_VARIANT = 0
|
|||||||
ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||||
# 9x/9xr radio
|
# 9x/9xr radio
|
||||||
ARCH = AVR
|
ARCH = AVR
|
||||||
|
LCDSIZE = 128
|
||||||
TRGT = avr-
|
TRGT = avr-
|
||||||
MCU = atmega64
|
MCU = atmega64
|
||||||
OPT = s
|
OPT = s
|
||||||
@@ -430,6 +432,7 @@ endif
|
|||||||
ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
||||||
# 9X/9XR radio with ATmega64 replaced by ATmega128
|
# 9X/9XR radio with ATmega64 replaced by ATmega128
|
||||||
ARCH = AVR
|
ARCH = AVR
|
||||||
|
LCDSIZE = 128
|
||||||
TRGT = avr-
|
TRGT = avr-
|
||||||
MCU = atmega128
|
MCU = atmega128
|
||||||
OPT = s
|
OPT = s
|
||||||
@@ -490,6 +493,7 @@ endif
|
|||||||
ifeq ($(PCB), $(filter $(PCB), 9X2561))
|
ifeq ($(PCB), $(filter $(PCB), 9X2561))
|
||||||
# 9X/9XR radio with ATmega64 replaced by ATmega2561
|
# 9X/9XR radio with ATmega64 replaced by ATmega2561
|
||||||
ARCH = AVR
|
ARCH = AVR
|
||||||
|
LCDSIZE = 128
|
||||||
TRGT = avr-
|
TRGT = avr-
|
||||||
MCU = atmega2561
|
MCU = atmega2561
|
||||||
OPT = s
|
OPT = s
|
||||||
@@ -546,6 +550,7 @@ endif
|
|||||||
ifeq ($(PCB), GRUVIN9X)
|
ifeq ($(PCB), GRUVIN9X)
|
||||||
# 9x radio with a gruvin9x replacement board
|
# 9x radio with a gruvin9x replacement board
|
||||||
ARCH = AVR
|
ARCH = AVR
|
||||||
|
LCDSIZE = 128
|
||||||
ifeq ($(PCBREV), REV0)
|
ifeq ($(PCBREV), REV0)
|
||||||
CPPDEFS = -DREV0
|
CPPDEFS = -DREV0
|
||||||
else
|
else
|
||||||
@@ -591,6 +596,7 @@ endif
|
|||||||
ifeq ($(PCB), MEGA2560)
|
ifeq ($(PCB), MEGA2560)
|
||||||
# ARDUINO2560 DIY RADIO
|
# ARDUINO2560 DIY RADIO
|
||||||
ARCH = AVR
|
ARCH = AVR
|
||||||
|
LCDSIZE = 128
|
||||||
TRGT = avr-
|
TRGT = avr-
|
||||||
MCU = atmega2560
|
MCU = atmega2560
|
||||||
OPT = s
|
OPT = s
|
||||||
@@ -631,6 +637,7 @@ endif
|
|||||||
ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
|
ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
|
||||||
# 9x/9XR radio with a sky9x replacement board
|
# 9x/9XR radio with a sky9x replacement board
|
||||||
ARCH = ARM
|
ARCH = ARM
|
||||||
|
LCDSIZE = 128
|
||||||
CPPDEFS = -Dat91sam3s4
|
CPPDEFS = -Dat91sam3s4
|
||||||
ifeq ($(PCB), 9XRPRO)
|
ifeq ($(PCB), 9XRPRO)
|
||||||
CPPDEFS += -DREVX
|
CPPDEFS += -DREVX
|
||||||
@@ -703,6 +710,7 @@ endif
|
|||||||
ifeq ($(PCB), TARANIS)
|
ifeq ($(PCB), TARANIS)
|
||||||
# TARANIS radio
|
# TARANIS radio
|
||||||
ARCH = ARM
|
ARCH = ARM
|
||||||
|
LCDSIZE = 212
|
||||||
ifeq ($(PCBREV), REV3)
|
ifeq ($(PCBREV), REV3)
|
||||||
CPPDEFS = -DREV3
|
CPPDEFS = -DREV3
|
||||||
SWR = YES
|
SWR = YES
|
||||||
@@ -858,9 +866,6 @@ ifeq ($(PCB), TARANIS)
|
|||||||
ifeq ($(CHANNELS_MONITOR_INV_HIDE), YES)
|
ifeq ($(CHANNELS_MONITOR_INV_HIDE), YES)
|
||||||
CPPDEFS += -DCHANNELS_MONITOR_INV_HIDE
|
CPPDEFS += -DCHANNELS_MONITOR_INV_HIDE
|
||||||
endif
|
endif
|
||||||
ifeq ($(SWR), YES)
|
|
||||||
CPPDEFS += -DSWR
|
|
||||||
endif
|
|
||||||
ifeq ($(PCBREV), REV9E)
|
ifeq ($(PCBREV), REV9E)
|
||||||
CPPSRC += targets/taranis/rotenc_driver.cpp
|
CPPSRC += targets/taranis/rotenc_driver.cpp
|
||||||
endif
|
endif
|
||||||
@@ -896,7 +901,7 @@ else
|
|||||||
TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi")
|
TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PCB), $(filter $(PCB), TARANIS))
|
ifeq ($(PCB), TARANIS)
|
||||||
GUISRC = gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/Taranis/view_main.cpp gui/view_statistics.cpp
|
GUISRC = gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/Taranis/view_main.cpp gui/view_statistics.cpp
|
||||||
else
|
else
|
||||||
GUISRC = gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/view_main.cpp gui/view_statistics.cpp
|
GUISRC = gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/view_main.cpp gui/view_statistics.cpp
|
||||||
@@ -944,7 +949,7 @@ ifeq ($(NAVIGATION), ROTENC)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TURNIGY_TRANSMITTER_FIX), YES)
|
ifeq ($(TURNIGY_TRANSMITTER_FIX), YES)
|
||||||
ifeq ($(PCB), TARANIS)
|
ifeq ($(PCB), $(filter $(PCB), TARANIS))
|
||||||
$(warning TURNIGY_TRANSMITTER_FIX is not available on this radio)
|
$(warning TURNIGY_TRANSMITTER_FIX is not available on this radio)
|
||||||
else
|
else
|
||||||
CPPDEFS += -DMODULE_ALWAYS_SEND_PULSES
|
CPPDEFS += -DMODULE_ALWAYS_SEND_PULSES
|
||||||
@@ -987,7 +992,7 @@ ifeq ($(BOLD), YES)
|
|||||||
CPPDEFS += -DBOLD_FONT
|
CPPDEFS += -DBOLD_FONT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(PCB), TARANIS)
|
ifneq ($(PCB), $(filter $(PCB), TARANIS))
|
||||||
ifeq ($(BATTGRAPH), YES)
|
ifeq ($(BATTGRAPH), YES)
|
||||||
CPPDEFS += -DBATTGRAPH
|
CPPDEFS += -DBATTGRAPH
|
||||||
endif
|
endif
|
||||||
@@ -1159,7 +1164,7 @@ ifeq ($(HELI), YES)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TEMPLATES), YES)
|
ifeq ($(TEMPLATES), YES)
|
||||||
ifneq ($(PCB), TARANIS)
|
ifneq ($(PCB), $(filter $(PCB), TARANIS))
|
||||||
CPPDEFS += -DTEMPLATES
|
CPPDEFS += -DTEMPLATES
|
||||||
CPPSRC += templates.cpp
|
CPPSRC += templates.cpp
|
||||||
endif
|
endif
|
||||||
@@ -1274,7 +1279,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# build bootloader
|
# build bootloader
|
||||||
ifeq ($(PCB), TARANIS)
|
ifeq ($(PCB), $(filter $(PCB), TARANIS))
|
||||||
bootloader.lbm: bootloader/bootloader_ramBoot.bin
|
bootloader.lbm: bootloader/bootloader_ramBoot.bin
|
||||||
$(BIN2LBM) $^ $@
|
$(BIN2LBM) $^ $@
|
||||||
|
|
||||||
@@ -1370,20 +1375,20 @@ translations/se.h: translations/se.h.txt
|
|||||||
fonts: $(patsubst %.png,%.lbm,$(wildcard fonts/*/*.png))
|
fonts: $(patsubst %.png,%.lbm,$(wildcard fonts/*/*.png))
|
||||||
|
|
||||||
fonts/%.lbm: fonts/%.png
|
fonts/%.lbm: fonts/%.png
|
||||||
$(IMG2LBM) $^ $@
|
$(IMG2LBM) $^ $@ $(LCDSIZE)
|
||||||
|
|
||||||
bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/9X/splash.xbm bitmaps/Taranis/splash.png bitmaps/Taranis/logo.bmp bitmaps/Taranis/icons.png bitmaps/9X/asterisk.xbm bitmaps/9X/about.png bitmaps/Taranis/about.png bitmaps/Taranis/asterisk.png
|
bitmaps/sticks.lbm: bitmaps/sticks.xbm bitmaps/9X/splash.xbm bitmaps/Taranis/splash.png bitmaps/Taranis/logo.bmp bitmaps/Taranis/icons.png bitmaps/9X/asterisk.xbm bitmaps/9X/about.png bitmaps/Taranis/about.png bitmaps/Taranis/asterisk.png
|
||||||
@echo
|
@echo
|
||||||
@echo "Convert bitmaps from xbm to lbm:"
|
@echo "Convert bitmaps from xbm to lbm:"
|
||||||
$(IMG2LBM) bitmaps/sticks_4x1.xbm bitmaps/sticks.lbm 1bit 4
|
$(IMG2LBM) bitmaps/sticks.xbm bitmaps/sticks.lbm $(LCDSIZE) 1bit 4
|
||||||
$(IMG2LBM) bitmaps/9X/asterisk.xbm bitmaps/9X/asterisk.lbm 1bit
|
$(IMG2LBM) bitmaps/9X/asterisk.xbm bitmaps/9X/asterisk.lbm $(LCDSIZE) 1bit
|
||||||
$(IMG2LBM) bitmaps/9X/splash.xbm bitmaps/9X/splash.lbm 1bit
|
$(IMG2LBM) bitmaps/9X/splash.xbm bitmaps/9X/splash.lbm $(LCDSIZE) 1bit
|
||||||
$(IMG2LBM) bitmaps/9X/about.png bitmaps/9X/about.lbm 1bit
|
$(IMG2LBM) bitmaps/9X/about.png bitmaps/9X/about.lbm $(LCDSIZE) 1bit
|
||||||
$(IMG2LBM) bitmaps/Taranis/splash.png bitmaps/Taranis/splash.lbm 4bits
|
$(IMG2LBM) bitmaps/Taranis/splash.png bitmaps/Taranis/splash.lbm $(LCDSIZE) 4bits
|
||||||
$(IMG2LBM) bitmaps/Taranis/logo.bmp bitmaps/Taranis/logo.lbm 4bits
|
$(IMG2LBM) bitmaps/Taranis/logo.bmp bitmaps/Taranis/logo.lbm $(LCDSIZE) 4bits
|
||||||
$(IMG2LBM) bitmaps/Taranis/icons.png bitmaps/Taranis/icons.lbm 4bits
|
$(IMG2LBM) bitmaps/Taranis/icons.png bitmaps/Taranis/icons.lbm $(LCDSIZE) 4bits
|
||||||
$(IMG2LBM) bitmaps/Taranis/about.png bitmaps/Taranis/about.lbm 4bits
|
$(IMG2LBM) bitmaps/Taranis/about.png bitmaps/Taranis/about.lbm $(LCDSIZE) 4bits
|
||||||
$(IMG2LBM) bitmaps/Taranis/asterisk.png bitmaps/Taranis/asterisk.lbm 4bits
|
$(IMG2LBM) bitmaps/Taranis/asterisk.png bitmaps/Taranis/asterisk.lbm $(LCDSIZE) 4bits
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PARSER = avr-cpp
|
PARSER = avr-cpp
|
||||||
|
|||||||
Regular → Executable
+25
-7
@@ -7,20 +7,27 @@ image = QtGui.QImage(sys.argv[1])
|
|||||||
width, height = image.size().width(), image.size().height()
|
width, height = image.size().width(), image.size().height()
|
||||||
|
|
||||||
f = open(sys.argv[2], "w")
|
f = open(sys.argv[2], "w")
|
||||||
|
lcdwidth = int(sys.argv[3])
|
||||||
|
|
||||||
if len(sys.argv) > 3:
|
if len(sys.argv) > 4:
|
||||||
what = sys.argv[3]
|
what = sys.argv[4]
|
||||||
else:
|
else:
|
||||||
for s in ("03x05", "04x06", "05x07", "08x10", "10x14", "22x38"):
|
for s in ("03x05", "04x06", "05x07", "08x10", "10x14", "22x38"):
|
||||||
if s in sys.argv[2]:
|
if s in sys.argv[2]:
|
||||||
what = s
|
what = s
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def writeSize(f, width, height):
|
||||||
|
if lcdwidth > 255:
|
||||||
|
f.write("%d,%d,%d,%d,\n" % (width%256, width/256, height%256, height/256))
|
||||||
|
else:
|
||||||
|
f.write("%d,%d,\n" % (width, height))
|
||||||
|
|
||||||
if what == "1bit":
|
if what == "1bit":
|
||||||
rows = 1
|
rows = 1
|
||||||
if len(sys.argv) > 4:
|
if len(sys.argv) > 5:
|
||||||
rows = int(sys.argv[4])
|
rows = int(sys.argv[5])
|
||||||
f.write("%d,%d,\n" % (width, height/rows))
|
writeSize(f, width, height/rows)
|
||||||
for y in range(0, height, 8):
|
for y in range(0, height, 8):
|
||||||
for x in range(width):
|
for x in range(width):
|
||||||
value = 0
|
value = 0
|
||||||
@@ -29,14 +36,25 @@ if what == "1bit":
|
|||||||
value += 1 << z
|
value += 1 << z
|
||||||
f.write("0x%02x," % value)
|
f.write("0x%02x," % value)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
elif what == "4bits":
|
elif what == "16bits":
|
||||||
colors = []
|
colors = []
|
||||||
f.write("%d,%d,\n" % (width, height))
|
f.write("%d,%d,\n" % (width, height))
|
||||||
|
for y in range(height):
|
||||||
|
for x in range(width):
|
||||||
|
pixel = image.pixel(x, y)
|
||||||
|
f.write("0x%1x%1x%1x%1x," % (Qt.qAlpha(pixel)/16, Qt.qRed(pixel)/16, Qt.qGreen(pixel)/16, Qt.qBlue(pixel)/16))
|
||||||
|
f.write("\n")
|
||||||
|
elif what == "4bits":
|
||||||
|
colors = []
|
||||||
|
writeSize(f, width, height)
|
||||||
for y in range(0, height, 2):
|
for y in range(0, height, 2):
|
||||||
for x in range(width):
|
for x in range(width):
|
||||||
value = 0xFF;
|
value = 0xFF;
|
||||||
gray1 = Qt.qGray(image.pixel(x, y))
|
gray1 = Qt.qGray(image.pixel(x, y))
|
||||||
gray2 = Qt.qGray(image.pixel(x, y+1))
|
if y+1 < height:
|
||||||
|
gray2 = Qt.qGray(image.pixel(x, y+1))
|
||||||
|
else:
|
||||||
|
gray2 = Qt.qRgb(255, 255, 255)
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
if (gray1 & (1<<(4+i))):
|
if (gray1 & (1<<(4+i))):
|
||||||
value -= 1<<i
|
value -= 1<<i
|
||||||
|
|||||||
Reference in New Issue
Block a user