51 Commits

Author SHA1 Message Date
Ivan Zorin
474fc5923b Make -m MODEL argument compatible with the main IronOS project build files & configs (+unify code style a bit) (#40)
* Add model name input argument compatibility with main IronOS project

* Fix var name according to PEP8 / code review
2023-10-27 04:44:33 +00:00
Ben V. Brown
b5e55ee1f1 Update README.md 2023-10-18 21:07:25 +11:00
Federico Di Lorenzo
5ec3a16c3f Add files via upload (#39)
* Add files via upload

* Update README.md
2023-08-21 09:11:45 +10:00
@MJerich MJerich
b313a84e10 new hack_the_planet image (#38)
* added hack_the_planet.png

* changed image url to match in the original repo
2023-08-06 23:03:35 +00:00
Ben V. Brown
3b02e3ea6f Expanding supported devices (#35) 2023-08-01 22:02:03 +10:00
Ben V. Brown
c10a130329 -j to zip 2022-08-21 15:42:15 +10:00
Ben V. Brown
6e9ed602a2 Update release.yml 2022-08-20 23:53:10 +10:00
Ben V. Brown
d39d58d79a Update release.yml 2022-08-20 23:52:26 +10:00
Ben V. Brown
248b2b5806 Test auto release 2022-08-20 23:51:06 +10:00
discip
9eed4b2dd4 removed some redundant entries (#28) 2022-08-20 23:24:59 +10:00
Ben V. Brown
1a5c7ac5f6 Update to generate nicer flipped logo file names (#29)
* Update img2logo.py

* Update img2logo.py
2022-08-20 23:03:45 +10:00
River B
92f4d50a73 add preview images and install instructions (#25)
* Add files via upload

* Create Install_Logo

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2022-08-20 11:21:25 +10:00
discip
c252b67c9a updated IronOS.gif (#27) 2022-08-10 11:08:02 +10:00
discip
2dd99ff5aa removed deprecated notes (#26) 2022-08-07 11:56:42 +10:00
Ben V. Brown
bd70b17cd6 Correct rotation for animations 2022-08-06 21:59:46 +10:00
Ben V. Brown
2942212437 Always make normal and flipped 2022-08-06 21:55:41 +10:00
Ben V. Brown
3c62bb7fe1 Remove _L files 2022-08-06 21:40:22 +10:00
Ben V. Brown
32e4db09ac Build flipped images in CI 2022-08-06 21:35:34 +10:00
Ben V. Brown
fbf0a8ac63 Add command line argument to rotate image 180 deg 2022-08-06 21:33:15 +10:00
Ben V. Brown
f4e5717e34 Print what file is being converted 2022-08-06 21:21:18 +10:00
River B
466022c12f Add files via upload (#19)
Adding extra logo's
2022-08-03 19:15:48 +10:00
discip
cb9c811bd9 added Pinecil | fixed some typos | added some information (#14) 2022-04-26 10:02:04 +10:00
Federico Di Lorenzo
ca0ed073e5 Adding a logo preview (#13)
* Adding a logo preview

Just a preview of the logos to facilitate the choise.

* Delete arcade_pac_man.gif

* Delete horizontal_bars_transitions.gif
2022-04-25 22:35:15 +10:00
Federico Di Lorenzo
a744ef1467 Logo addition #2 (#12)
* Logos addition  #2

* Optimizing Pac Man GIF

* Add files via upload

* Delete ad_maiora.png

* Add files via upload

* Update README.md

* Update README.md

* Add files via upload

* Replacing frames instead of combining

* Hopefully working

* Dropping Pac Man GIF

* Dropping Horizontal Bars Transition GIF
2022-04-25 10:07:30 +10:00
Ben V. Brown
1d5bcd7bb0 Merge pull request #10 from federicodilo/main
Bootup logos addition #1
2022-03-17 21:27:33 +11:00
federicodilo
7fdc4dc679 Last change 2022-03-16 22:51:23 +01:00
federicodilo
8b344d7f0b Delete arcade_spaceship.png 2022-03-16 22:50:11 +01:00
federicodilo
041e107aec Delete horizontal_bars_transitions1.gif 2022-03-16 22:50:03 +01:00
federicodilo
3658be86dd Arcade games logos
Thanks to @Journesaladbar
2022-03-16 01:01:20 +01:00
federicodilo
12b02f1ae2 Add files via upload 2022-03-16 00:29:15 +01:00
federicodilo
08da9885b3 Delete terminal.gif 2022-03-16 00:28:37 +01:00
federicodilo
de8a9c89c8 Add files via upload 2022-03-16 00:27:41 +01:00
federicodilo
f8a77bdc5f Add files via upload 2022-03-16 00:02:08 +01:00
federicodilo
5e388107e7 Merge branch 'Ralim:main' into main 2022-03-15 18:01:20 +01:00
Ben V. Brown
fa8cf78cc8 Merge pull request #8 from Ralim/dev
Check to make sure frame timing does not change partway through
2022-03-13 18:12:51 +11:00
Ben V. Brown
6c9fa9519d Check to make sure frame timing does not change partway through 2022-03-13 17:30:18 +11:00
federicodilo
dd9c77f6b0 Add files via upload 2022-03-11 21:50:50 +01:00
federicodilo
1a2a27b3a9 Additions to logos 2022-03-11 21:45:19 +01:00
Ben V. Brown
29c63fc6f8 Empty frame marker 2022-03-06 21:32:50 +11:00
Ben V. Brown
806e6a266d Update run.sh 2022-02-24 22:01:29 +11:00
Ben V. Brown
388e97cee4 Update img2logo.py 2022-02-24 22:00:27 +11:00
Ben V. Brown
0181963db6 Merge branch 'main' of github.com:Ralim/IronOS-Meta 2022-02-24 21:44:25 +11:00
Ben V. Brown
124fc0ccfe Update img2logo.py 2022-02-24 21:44:21 +11:00
Ben V. Brown
595d2c7353 Merge pull request #6 from federicodilo/main
Bootup_logos
2022-02-24 21:39:10 +11:00
Ben V. Brown
1a5dae2283 Constrain frame timing on animations 2022-02-24 21:35:58 +11:00
federicodilo
bcef360fe0 Bootup_logos
A summary of the bootup logos I've made, one of which you may not be interested in (you choose which one) 😁
2022-02-20 15:19:01 +01:00
Ben V. Brown
36c3cf0167 Merge pull request #5 from discip/patch-1
final IronOS.gif & fixing frame enumeration
2022-02-16 08:43:56 +11:00
discip
3eed987ce2 final IronOS.gif 2022-02-15 15:24:26 +01:00
discip
0de493954a fixing the enumeration/count of frames 2022-02-15 13:35:23 +01:00
Ben V. Brown
f5d5eade81 Merge pull request #4 from Ralim/p-size
Print size of frames
2022-02-15 20:46:11 +11:00
Ben V. Brown
1224b02750 Print size of frames
Update img2logo.py
2022-02-15 20:42:56 +11:00
34 changed files with 257 additions and 38 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: |

69
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
---
name: "release"
on:
push:
branches:
- "main"
jobs:
release:
name: "Release"
runs-on: "ubuntu-22.04"
steps:
- name: Install dependencies (apk)
run: sudo apt update && sudo apt-get install -y git python3 python3-pillow
- uses: actions/checkout@v3
with:
submodules: true
- name: prep
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/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/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 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:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Release"
files: |
*.zip

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
Bootup Logos/Images/f1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

View File

@@ -1,15 +1,19 @@
# 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.
They can be (re)programmed as many times as desired after flashing the normal firmware.
They can be (re)programmed as many times as desired, after flashing the normal firmware.
### Data storage format
The data is stored into the second last page of flash, this gives 1024 bytes of space for the entire payload of bootup logo data.
The data is stored into the second last page of flash. This gives 1024 bytes of space for the entire payload of bootup-logo-data.
The first byte is marked purely to indicate that the page is programmed and which revision of the boot logo logic it is
The next byte indicates the frame timing in milliseconds, or `0` to indicate only show first frame for whole bootloader duration (still image mode)
Then the OLED buffer is cleared to black, then every frame is encoded as either:
The first byte is marked purely to indicate that the page is programmed and which revision of the boot-logo-logic it is.
The next byte indicates the frame timing in milliseconds, or `0` to indicate: Only show the first frame for the whole bootloader duration (still image mode).
After the OLED buffer is cleared to black, every frame is encoded as either:
### Full frame updates
@@ -18,5 +22,44 @@ Then the OLED buffer is cleared to black, then every frame is encoded as either:
### Delta frame update
`[count of updates][[index,data][index,data][index,data][index,data]]`
Where index is byte location into screen buffer, and data is the new byte to plonk down there
This just overwrites individual bytes in the output buffer
Where index is byte location into screen buffer and data is the new byte to plonk down there.
This just overwrites individual bytes in the output buffer.
## Logos preview
**Static logos**
|Logo |Filename |Note |
|:-------------:|:-------------:|:-----:|
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/ad_maiora.png)|ad_maiora.png|English: "Towards greater things"|
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/arcade_galaga.png)|arcade_galaga.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/arcade_pac_man.png)|arcade_pac_man.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/bender.png)|bender.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/doggie_bone.png)|doggie_bone.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/f1.png)|f1.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/halo_master_chief_helmet.png)|halo_master_chief_helmet.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/horror_vacui_IronOS.png)|horror_vacui_IronOS.png||
|![IronOS](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/IronOS.png)|IronOS.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/Logo1b.png)|Logo1b.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/lot_of_tin_is_too_few_tin_IT.png)|lot_of_tin_is_too_few_tin_IT.png|English: "A lot of tin is too few tin"|
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/majorTom.png)|majorTom.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/open_sw_hw_IronOS_logos.png)|open_sw_hw_IronOS_logos.png||
|![Pinecil](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/Pinecil.png)|Pinecil.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/science.png)|science.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/skulls.png)|skulls.png||
|![TS100](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/TS100.png)|TS100.png||
|![TS80](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/TS80.png)|TS80.png||
|![TS80P](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/TS80P.png)|TS80P.png||
|![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||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/hack_the_planet.png)|hack_the_planet.png||
**Animated logos**
|Logo \* |Filename |Note |
|:-------------:|:-------------:|:-----:|
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/CRT_horror_vacui.gif) |CRT_horror_vacui.gif||
|![IronOS](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/IronOS.gif)|IronOS.gif||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/terminal.gif)|terminal.gif||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/hack_the_planet.gif)|hack_the_planet.gif||
_* Click the individual logo to see its animation, if you missed it here._

View File

@@ -22,6 +22,7 @@ LCD_PAGE_SIZE = 1024
DATA_PROGRAMMED_MARKER = 0xAA
FULL_FRAME_MARKER = 0xFF
EMPTY_FRAME_MARKER = 0xFE # If this marker is used to start a frame, the frame is a 0-length delta frame
class MiniwareSettings:
@@ -31,6 +32,26 @@ 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
@@ -39,6 +60,13 @@ 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
@@ -103,7 +131,9 @@ def get_screen_blob(previous_frame: bytearray, this_frame: bytearray):
"""
outputData = []
delta = calculate_frame_delta_encode(previous_frame, this_frame)
if len(delta) < (len(this_frame)):
if len(delta) == 0:
outputData.append(EMPTY_FRAME_MARKER)
elif len(delta) < (len(this_frame)):
outputData.append(len(delta))
outputData.extend(delta)
# print("delta encoded frame")
@@ -114,7 +144,7 @@ def get_screen_blob(previous_frame: bytearray, this_frame: bytearray):
return outputData
def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, threshold: int):
def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, threshold: int, flip_frames):
"""
Convert the gif into our best effort startup animation
We are delta-encoding on a byte by byte basis
@@ -133,23 +163,38 @@ def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, thresh
for framenum in range(0, imageIn.n_frames):
imageIn.seek(framenum)
image = imageIn
if flip_frames:
image = image.rotate(180)
frameb = still_image_to_bytes(image, negative, dither, threshold, None)
frameData.append(frameb)
# Store inter-frame duration
frameDuration_ms = image.info["duration"]
if frameDuration_ms > 255:
frameDuration_ms = 255
if frameTiming is None or frameTiming == 0:
if frameTiming is None:
frameTiming = frameDuration_ms
else:
delta = frameDuration_ms / frameTiming
if delta > 1.05 or delta < 0.95:
print(f"ERROR: You have a frame that is different to the first frame time. Mixed rates are not supported")
sys.exit(-1)
print(f"Found {len(frameData)} frames, interval {frameTiming}ms")
# We have no mangled the image into our frambuffers
frameTiming = frameTiming / 5
if frameTiming <= 0 or frameTiming > 254:
newTiming = max(frameTiming, 1)
newTiming = min(newTiming, 254)
print(f"Inter frame delay {frameTiming} is out of range, and is being adjusted to {newTiming*5}")
frameTiming = newTiming
# We have now mangled the image into our framebuffers
# Now we can build our output data blob
# First we always start with a full first frame; future optimisation to check if we should or not
outputData = [DATA_PROGRAMMED_MARKER]
outputData.append(frameTiming)
outputData.extend(get_screen_blob([0x00] * (LCD_NUM_BYTES), frameData[0]))
outputData.append(int(frameTiming))
first_frame = get_screen_blob([0x00] * (LCD_NUM_BYTES), frameData[0])
outputData.extend(first_frame)
print(f"Frame 1 encoded to {len(first_frame)} bytes")
"""
Format for each frame block is:
@@ -164,20 +209,22 @@ def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, thresh
if (len(outputData) + len(frameBlob)) > LCD_PAGE_SIZE:
print(f"Truncating animation after {id} frames as we are out of space")
break
print(f"Frame {id} encoded to {len(frameBlob)} bytes")
print(f"Frame {id + 1} encoded to {len(frameBlob)} bytes")
outputData.extend(frameBlob)
print(f"Total size used: {len(outputData)} of 1024 bytes")
return outputData
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,
):
"""
Convert 'input_filename' image file into Intel hex format with data
@@ -202,8 +249,10 @@ def img2hex(
raise IOError('error reading image file "{}": {}'.format(input_filename, e))
if getattr(image, "is_animated", False):
data = animated_image_to_bytes(image, negative, dither, threshold)
data = animated_image_to_bytes(image, negative, dither, threshold,flip)
else:
if flip:
image = image.rotate(180)
# magic/required header
data = [DATA_PROGRAMMED_MARKER, 0x00] # Timing value of 0
image_bytes = still_image_to_bytes(image, negative, dither, threshold, preview_filename)
@@ -213,11 +262,35 @@ def img2hex(
if len(data) < LCD_PAGE_SIZE:
pad = [0] * (LCD_PAGE_SIZE - len(data))
data.extend(pad)
deviceSettings = MiniwareSettings
if isPinecil:
# Set device settings depending on input `-m` argument
device_name = device_model_name.lower()
if device_name == "miniware" or device_name == "ts100" or device_name == "ts80" or device_name == "ts80p":
deviceSettings = MiniwareSettings
elif device_name == "pinecilv1" or device_name == "pinecil":
deviceSettings = PinecilSettings
# Generate both possible outputs
output_name = output_filename_base + os.path.basename(input_filename)
elif device_name == "pinecilv2":
deviceSettings = Pinecilv2Settings
elif device_name == "ts101":
deviceSettings = TS101Settings
elif device_name == "s60":
deviceSettings = S60Settings
elif device_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))
if flip:
base = split_name[0]
ext = split_name[1]
base =base+"_L"
split_name = [base,ext]
output_name = output_filename_base +split_name[0] +split_name[1]
DFUOutput.writeFile(
output_name + ".dfu",
data,
@@ -256,9 +329,10 @@ def parse_commandline():
"-n",
"--negative",
action="store_true",
help="photo negative: exchange black and white " "in output",
help="photo negative: exchange black and white in output",
)
parser.add_argument(
"-t",
"--threshold",
@@ -281,8 +355,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",
@@ -302,17 +375,30 @@ 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,
flip = True,
)

View File

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

1
Documents/Install_Logo Normal file
View File

@@ -0,0 +1 @@

View File

@@ -6,3 +6,20 @@ This includes photographs of hardware, datasheets, schematics and of course **bo
This repository uses github actions to automagically build the logos for each device.
Periodically a "release" will be tagged and pre-compiled logo's will be put there as well to make it easy.
# Boot-Up Logos
The IronOS firmware supports a user created bootup logo.
By default, there is _not_ one included in the firmware. This means that once flashed they generally stay. If you want no logo again, you would have to flash a blank image to the bootup logo.
- Safe & Fun: will not over write your firmware
- Easy install: use dfu tool just like updating firmware (or Pine64 Updater if you have a Pinecil).
## Generating the Logo files
There are community logo's already converted and ready to use in [IronOS-Meta/releases](https://github.com/Ralim/IronOS-Meta/releases).
Download the zip for Pinecil or Miniware and then install using the instructions on the [main IronOS documentation](https://ralim.github.io/IronOS/Logo/).
Alternatively if you want to make your own logo files, there is also documentation on how best to do this in the [main IronOS documentation](https://ralim.github.io/IronOS/Logo/).