New ML support - script tunning

This commit is contained in:
Robert Pelnar 2018-06-08 00:17:56 +02:00
parent c58e4cea0d
commit 3417392791
4 changed files with 11 additions and 11 deletions

View file

@ -30,10 +30,10 @@ LANG=$1
IGNORE_MISSING_TEXT=1
function finish
finish()
{
echo
if [ "$1" == "0" ]; then
if [ "$1" = "0" ]; then
echo "postbuild.sh finished with success" >&2
else
echo "postbuild.sh finished with errors!" >&2
@ -71,7 +71,7 @@ echo "OK" >&2
echo -n " checking textaddr.txt..." >&2
if cat textaddr.txt | grep "^ADDR NF" >/dev/null; then
echo "NG! - some texts not found in lang_en.txt!"
if [ $(("0$IGNORE_MISSING_TEXT")) -eq 0 ]; then
if [ $IGNORE_MISSING_TEXT -eq 0 ]; then
finish 1
else
echo " missing text ignored!" >&2
@ -82,7 +82,7 @@ fi
#update progmem1 id entries in binary file
echo -n " extracting binary..." >&2
$OBJCOPY -I ihex -O binary $OUTDIR/Firmware.ino.hex ./firmware.bin
$OBJCOPY -I ihex -O binary $INOHEX ./firmware.bin
echo "OK" >&2
#update binary file
@ -93,7 +93,7 @@ echo -n " primary language ids..." >&2
cat textaddr.txt | grep "^ADDR OK" | cut -f3- -d' ' | sed "s/^0000/0x/" |\
awk '{ id = $2 - 1; hi = int(id / 256); lo = int(id - 256 * hi); printf("%d \\\\x%02x\\\\x%02x\n", strtonum($1), lo, hi); }' |\
while read addr data; do
echo -n -e $data | dd of=./firmware.bin bs=1 count=2 seek=$addr conv=notrunc oflag=nonblock 2>/dev/null
/bin/echo -n -e $data | dd of=./firmware.bin bs=1 count=2 seek=$addr conv=notrunc oflag=nonblock 2>/dev/null
done
echo "OK" >&2

View file

@ -122,10 +122,10 @@ cat $PROGMEM.chr | \
sed 's/\\x1b/\\\\\\x1b/g;' | \
sed 's/\\x01/\\\\\\x01/g;' | \
sed 's/\\xf8/\\\\\\xf8/g;' | \
sed 's/\\x00$//;s/^/echo -e "/;s/$/"/' | sh > $PROGMEM.var
sed 's/\\x00$//;s/^/\/bin\/echo -e "/;s/$/"/' | sh > $PROGMEM.var
#this step can be omitted because .txt file is not used
#cat $PROGMEM.var | sed 's/\r/\n/g' |sed -E 's/^[0-9a-f]{8} [^ ]* //' >$PROGMEM.txt
#cat $PROGMEM.var | sed 's/\r/\n/g' | sed -E 's/^[0-9a-f]{8} [^ ]* //' >$PROGMEM.txt
echo "progmem.sh finished" >&2

View file

@ -34,7 +34,7 @@ text=''
if [ -z "$addr" ]; then
addr=$num
else
if [ "$text" == "$txt" ]; then
if [ "$text" = "$txt" ]; then
addr="$addr $num"
else
echo "ADDR NF $addr $text"
@ -46,7 +46,7 @@ text=''
if [ -z "$addr" ]; then
echo "TEXT NF $num $txt"
else
if [ "$text" == "$txt" ]; then
if [ "$text" = "$txt" ]; then
if [ ${#addr} -eq 8 ]; then
echo "ADDR OK $addr $num"
else

View file

@ -13,10 +13,10 @@ LANG=$1
if [ -z "$LANG" ]; then LANG='cz'; fi
#
function finish
finish()
{
echo
if [ "$1" == "0" ]; then
if [ "$1" = "0" ]; then
echo "update_lang.sh finished with success" >&2
else
echo "update_lang.sh finished with errors!" >&2