1
0
forked from me/IronOS-Meta

Expanding supported devices (#35)

This commit is contained in:
Ben V. Brown
2023-08-01 21:38:09 +10:00
committed by Ben V. Brown
parent c10a130329
commit 3b02e3ea6f
5 changed files with 129 additions and 61 deletions

View File

@@ -10,17 +10,19 @@ jobs:
strategy:
matrix:
include:
- args: "-m"
model: "miniware"
- args: "-p"
model: "pinecil"
- model: "miniware"
- model: "pinecilv1"
- model: "pinecilv2"
- model: "mhp30"
- model: "ts101"
- model: "s60"
fail-fast: true
steps:
- name: Install dependencies (apk)
run: apk add --no-cache git python3 py3-pip zlib py3-pillow
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
@@ -28,13 +30,13 @@ jobs:
run: mkdir -p /tmp/${{ matrix.model }}
- name: build all files for the device
run: cd Bootup\ Logos && ./run.sh /tmp/${{ matrix.model }}/ ${{matrix.args}}
run: cd Bootup\ Logos && ./run.sh /tmp/${{ matrix.model }}/ -m ${{matrix.model}}
- name: build logo erase file
run: cd Bootup\ Logos && python3 img2logo.py -E erase_stored_image /tmp/${{ matrix.model }}/ ${{matrix.args}}
run: cd Bootup\ Logos && python3 img2logo.py -E erase_stored_image /tmp/${{ matrix.model }}/ -m ${{matrix.model}}
- name: Archive artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.model }}
path: |

View File

@@ -15,21 +15,48 @@ jobs:
- name: Install dependencies (apk)
run: sudo apt update && sudo apt-get install -y git python3 python3-pillow
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true
- name: prep
run: mkdir -p /tmp/pinecil && mkdir -p /tmp/miniware
run: |
mkdir -p /tmp/pinecilv1 && \
mkdir -p /tmp/pinecilv2 && \
mkdir -p /tmp/miniware && \
mkdir -p /tmp/ts101 && \
mkdir -p /tmp/mhp30 && \
mkdir -p /tmp/s60
- name: build all files for the device
run: cd Bootup\ Logos && ./run.sh /tmp/pinecil/ -p && ./run.sh /tmp/miniware/ -m
run: |
cd Bootup\ Logos && \
./run.sh /tmp/pinecilv1/ -m pinecilv1 && \
./run.sh /tmp/pinecilv2/ -m pinecilv2 && \
./run.sh /tmp/miniware/ -m miniware && \
./run.sh /tmp/ts101/ -m ts101 && \
./run.sh /tmp/mhp30/ -m mhp30 && \
./run.sh /tmp/s60/ -m s60
- name: build logo erase file
run: cd Bootup\ Logos && python3 img2logo.py -E erase_stored_image /tmp/pinecil/ -p && python3 img2logo.py -E erase_stored_image /tmp/miniware/ -m
run: |
cd Bootup\ Logos && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv1/ -m pinecilv1 && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv2/ -m pinecilv2 && \
python3 img2logo.py -E erase_stored_image /tmp/miniware/ -m miniware && \
python3 img2logo.py -E erase_stored_image /tmp/ts101/ -m ts101 && \
python3 img2logo.py -E erase_stored_image /tmp/mhp30/ -m mhp30 && \
python3 img2logo.py -E erase_stored_image /tmp/s60/ -m s60
- name: compress logo files
run: zip -rj pinecil.zip /tmp/pinecil/* && zip -rj miniware.zip /tmp/miniware/*
run: |
zip -rj pinecilv1.zip /tmp/pinecilv1/* && \
zip -rj miniware.zip /tmp/miniware/* && \
zip -rj pinecilv2.zip /tmp/pinecilv2/* && \
zip -rj ts101.zip /tmp/ts101/* && \
zip -rj mhp30.zip /tmp/mhp30/* && \
zip -rj s60.zip /tmp/s60/*
- uses: "marvinpinto/action-automatic-releases@latest"
with:
@@ -39,3 +66,4 @@ jobs:
title: "Release"
files: |
*.zip

View File

@@ -1,3 +1,5 @@
# Boot up Logos
## Boot up logo's are logos or animations shown on boot of IronOS
These are programmed into the device just like the normal firmware.
@@ -51,7 +53,6 @@ This just overwrites individual bytes in the output buffer.
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wh_40k.png)|wh_40k.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wwii_kilroy.png)|wwii_kilroy.png||
**Animated logos**
|Logo \* |Filename |Note |
|:-------------:|:-------------:|:-----:|

View File

@@ -32,7 +32,25 @@ class MiniwareSettings:
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class S60Settings:
IMAGE_ADDRESS = 0x08000000 + (62 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class TS101Settings:
IMAGE_ADDRESS = 0x08000000 + (126 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class MHP30Settings:
IMAGE_ADDRESS = 0x08000000 + (126 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class PinecilSettings:
IMAGE_ADDRESS = 0x0801F800
DFU_TARGET_NAME = b"Pinecil"
@@ -40,6 +58,14 @@ class PinecilSettings:
DFU_PINECIL_VENDOR = 0x28E9
DFU_PINECIL_PRODUCT = 0x0189
class Pinecilv2Settings:
IMAGE_ADDRESS = (1016 * 1024) # its 2 4k erase pages inset
DFU_TARGET_NAME = b"Pinecilv2"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x28E9 # These are ignored by blisp so doesnt matter what we use
DFU_PINECIL_PRODUCT = 0x0189 # These are ignored by blisp so doesnt matter what we use
def still_image_to_bytes(image: Image, negative: bool, dither: bool, threshold: int, preview_filename):
# convert to luminance
@@ -190,11 +216,11 @@ def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, thresh
def img2hex(
input_filename,
device_model_name:str,
preview_filename=None,
threshold=128,
dither=False,
negative=False,
isPinecil=False,
make_erase_image=False,
output_filename_base="out",
flip=False,
@@ -235,9 +261,21 @@ def img2hex(
if len(data) < LCD_PAGE_SIZE:
pad = [0] * (LCD_PAGE_SIZE - len(data))
data.extend(pad)
if device_model_name == "miniware":
deviceSettings = MiniwareSettings
if isPinecil:
elif device_model_name == "pinecilv1":
deviceSettings = PinecilSettings
elif device_model_name == "pinecilv2":
deviceSettings = Pinecilv2Settings
elif device_model_name == "ts101":
deviceSettings = TS101Settings
elif device_model_name == "s60":
deviceSettings = S60Settings
elif device_model_name == "mhp30":
deviceSettings = MHP30Settings
else:
print("Could not determine device type")
sys.exit(-1)
# Split name from extension so we can mangle in the _L suffix for flipped images
split_name = os.path.splitext( os.path.basename(input_filename))
@@ -313,8 +351,7 @@ def parse_commandline():
help="generate a logo erase file instead of a logo",
)
parser.add_argument("-p", "--pinecil", action="store_true", help="generate files for Pinecil")
parser.add_argument("-m", "--miniware", action="store_true", help="generate files for miniware")
parser.add_argument("-m", "--model", help="device model name")
parser.add_argument(
"-v",
"--version",
@@ -334,32 +371,32 @@ if __name__ == "__main__":
sys.stderr.write('Won\'t overwrite existing file "{}" (use --force ' "option to override)\n".format(args.preview))
sys.exit(1)
if args.miniware == False and args.pinecil == False:
sys.stderr.write("You must provide --miniware or --pinecil to select your model")
sys.exit(1)
print(f"Converting {args.input_filename} => {args.output_filename}")
img2hex(
input_filename=args.input_filename,
output_filename_base=args.output_filename,
device_model_name=args.model,
preview_filename=args.preview,
threshold=args.threshold,
dither=args.dither,
negative=args.negative,
make_erase_image=args.erase,
isPinecil=args.pinecil,
flip = False,
)
img2hex(
input_filename=args.input_filename,
output_filename_base=args.output_filename,
device_model_name=args.model,
preview_filename=args.preview,
threshold=args.threshold,
dither=args.dither,
negative=args.negative,
make_erase_image=args.erase,
isPinecil=args.pinecil,
flip = True,
)

View File

@@ -2,4 +2,4 @@
echo $1
echo $2
set -e
find Images/ -type f -exec python3 img2logo.py {} "$1" "$2" \;
find Images/ -type f -exec python3 img2logo.py {} "$1" "$2" "$3" \;