Browse Source

Update Justfiles a bit

Fix formatting of graphics header files in preparation for automatic code formatting
PASS1-137
Ken Carpenter 3 years ago
parent
commit
403773a50f
  1. 20
      ports/stm32/Justfile
  2. 3
      ports/stm32/boards/Passport/bootloader/Justfile
  3. 6
      ports/stm32/boards/Passport/bootloader/bootloader_graphics.h
  4. 6
      ports/stm32/boards/Passport/firmware_graphics.h
  5. 10
      ports/stm32/boards/Passport/graphics/c/cbuild.py

20
ports/stm32/Justfile

@ -51,6 +51,10 @@ clean:
# Misc. Commands
#
# Launch OCD, run a command and then exit
run-ocd-command command:
sudo /usr/local/bin/openocd -f stlink.cfg -c "adapter speed 1000; transport select hla_swd" -f stm32h7x.cfg -c "init; reset halt; {{command}}" -c "exit"
# Build all Python graphics
graphics-py:
just -f boards/Passport/graphics/py/Justfile build
@ -88,18 +92,18 @@ hash filepath:
# SHA256
sha=`shasum -b -a 256 {{filepath}} | sed -rn 's/^(.*) .*$/\1/p'`
echo -e "\nSHA256: $sha"
echo -e "(shasum -b -a 256 $filename)\n"
echo -e "\n\`SHA256: $sha\`"
echo -e "\`(shasum -b -a 256 $filename)\`\n"
# MD5
md5=`mdsum {{filepath}} | sed -rn 's/^(.*) .*$/\1/p'`
echo "MD5: $md5"
echo -e "(md5 $filename or mdsum $filename)\n"
echo "\`MD5: $md5\`"
echo -e "\`(md5 $filename or mdsum $filename)\`\n"
# Build Hash
build_hash=`cosign -f {{filepath}} -x | sed -rn 's/^FW Build Hash: (.*)$/\1/p'`
echo -e "Build Hash: $build_hash"
echo -e "(Developers Only)\n"
echo -e "\`Build Hash: $build_hash\`"
echo -e "\`(Developers Only)\`\n"
# Run all tests
test:
@ -123,7 +127,3 @@ fmt-c:
# Format the project's source code under boards/Passport
fmt: fmt-py fmt-c
# Bootloader

3
ports/stm32/boards/Passport/bootloader/Justfile

@ -8,12 +8,13 @@ run-ocd-command command:
# Build the bootloader (debug, release, locked or production)
# TODO: Need to handle {{rel}} for locked and production, which should look in release folder for binary
build rel="release":
@echo "\nBuilding Bootloader..."
make {{rel}}
@echo "\nAppending secrets to the end..."
add-secrets -b arm/release/bootloader.bin -s secrets
add-secrets -b arm/{{rel}}/bootloader.bin -s secrets
@echo "\nBootloader Build Complete"

6
ports/stm32/boards/Passport/bootloader/bootloader_graphics.h

@ -8,9 +8,9 @@
#include <stdint.h>
typedef struct _Image {
int16_t width;
int16_t height;
int16_t byte_width;
int16_t width;
int16_t height;
int16_t byte_width;
uint8_t* data;
} Image;

6
ports/stm32/boards/Passport/firmware_graphics.h

@ -8,9 +8,9 @@
#include <stdint.h>
typedef struct _Image {
int16_t width;
int16_t height;
int16_t byte_width;
int16_t width;
int16_t height;
int16_t byte_width;
uint8_t* data;
} Image;

10
ports/stm32/boards/Passport/graphics/c/cbuild.py

@ -10,7 +10,7 @@ import zlib
def read_text(fname):
w = 0
rows = []
rows = []
Z = b'\0'
F = b'\xff'
@ -59,7 +59,7 @@ def crunch(n):
#print(' / '.join("%d => %d" % (wb,len(d)) for wb,d in a))
return a[0]
def gen_header(outfile, fnames):
@ -78,9 +78,9 @@ def gen_header(outfile, fnames):
#include <stdint.h>
typedef struct _Image {
int16_t width;
int16_t height;
int16_t byte_width;
int16_t width;
int16_t height;
int16_t byte_width;
uint8_t* data;
} Image;

Loading…
Cancel
Save