mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 05:06:39 +01:00
Added firmware packs
This commit is contained in:
BIN
binaries/AP_FW_Pack.bin
Normal file
BIN
binaries/AP_FW_Pack.bin
Normal file
Binary file not shown.
BIN
binaries/Tag_FW_Pack.bin
Normal file
BIN
binaries/Tag_FW_Pack.bin
Normal file
Binary file not shown.
@@ -16,3 +16,5 @@ echo -e "\n\nBuilding 1.54 version..."
|
||||
make BUILD=zbs154v033 CPU=8051 SOC=zbs243 > /dev/null
|
||||
mv main.bin ../binaries/AP_FW_1.54.bin -v
|
||||
make clean > /dev/null
|
||||
|
||||
php packagebinaries.php
|
||||
|
||||
50
zbs243_AP_FW/packagebinaries.php
Normal file
50
zbs243_AP_FW/packagebinaries.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
$types[0x00] = "AP_FW_1.54.bin";
|
||||
$types[0x01] = "AP_FW_2.9.bin";
|
||||
$types[0xF0] = "AP_FW_Segmented_UK.bin";
|
||||
$types[0xFF] = "AP_FW_Nodisplay.bin";
|
||||
|
||||
$binpath = "../binaries/";
|
||||
$tocmaxsize = 512;
|
||||
|
||||
$toc = array();
|
||||
$output = '';
|
||||
$output = str_pad($output,$tocmaxsize,"\0");
|
||||
|
||||
$version = exec("cat main.c | grep version | grep uint16_t");
|
||||
list($blaat, $version) = explode("= 0x",$version);
|
||||
if(strlen($version)<4)die("Couldn't read version from main.c, please check. I got $version");
|
||||
$version = hexdec($version);
|
||||
|
||||
exec("ls -1 $binpath | grep 'AP_FW' | grep -v Pack", $binaries);
|
||||
foreach($binaries as $file){
|
||||
$file = trim($file);
|
||||
$type = -1;
|
||||
foreach($types as $typeid => $typefile){
|
||||
if($typefile == $file){
|
||||
$type = $typeid;
|
||||
}
|
||||
}
|
||||
if($type==-1)die("We don't recognize filetype <$file>, sorry...\n");
|
||||
$binary = file_get_contents($binpath.$file);
|
||||
$length = strlen($binary);
|
||||
$offset = strlen($output);
|
||||
$subarr['type']=$type;
|
||||
$subarr['version']=$version;
|
||||
$subarr['name']=$file;
|
||||
$subarr['offset']=$offset;
|
||||
$subarr['length']=$length;
|
||||
$toc[] = $subarr;
|
||||
$output.=$binary;
|
||||
}
|
||||
|
||||
$jtoc = json_encode($toc);
|
||||
$tocsize = strlen($jtoc);
|
||||
if($tocsize>$tocmaxsize)die("TOC is too big! adjust size and try again\n");
|
||||
$output = substr_replace($output,$jtoc,0,strlen($jtoc));
|
||||
file_put_contents($binpath."AP_FW_Pack.bin", $output);
|
||||
print_r($toc);
|
||||
echo "All done.\n";
|
||||
|
||||
|
||||
@@ -20,3 +20,5 @@ echo -e "\n\nBuilding 2.9 (UC8151) version..."
|
||||
make BUILD=zbs29_uc8151 CPU=8051 SOC=zbs243 > /dev/null
|
||||
mv main.bin ../binaries/Tag_FW_2.9-uc8151.bin -v
|
||||
make clean > /dev/null
|
||||
|
||||
php packagebinaries.php
|
||||
|
||||
53
zbs243_Tag_FW/packagebinaries.php
Normal file
53
zbs243_Tag_FW/packagebinaries.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
$types[0x00] = "Tag_FW_1.54.bin";
|
||||
$types[0x01] = "Tag_FW_2.9.bin";
|
||||
$types[0xF0] = "Tag_FW_Segmented_UK.bin";
|
||||
$types[0x02] = "Tag_FW_4.2.bin";
|
||||
$types[0x11] = "Tag_FW_2.9-uc8151.bin";
|
||||
|
||||
$binpath = "../binaries/";
|
||||
$tocmaxsize = 512;
|
||||
|
||||
$toc = array();
|
||||
$output = '';
|
||||
$output = str_pad($output,$tocmaxsize,"\0");
|
||||
|
||||
/*
|
||||
$version = exec("cat main.c | grep version | grep uint16_t");
|
||||
list($blaat, $version) = explode("= 0x",$version);
|
||||
if(strlen($version)<4)die("Couldn't read version from main.c, please check. I got $version");
|
||||
$version = hexdec($version);
|
||||
*/
|
||||
$version = 0;
|
||||
|
||||
exec("ls -1 $binpath | grep 'Tag_FW' | grep -v battery | grep -v Pack", $binaries);
|
||||
foreach($binaries as $file){
|
||||
$file = trim($file);
|
||||
$type = -1;
|
||||
foreach($types as $typeid => $typefile){
|
||||
if($typefile == $file){
|
||||
$type = $typeid;
|
||||
}
|
||||
}
|
||||
if($type==-1)die("We don't recognize filetype <$file>, sorry...\n");
|
||||
$binary = file_get_contents($binpath.$file);
|
||||
$length = strlen($binary);
|
||||
$offset = strlen($output);
|
||||
$subarr['type']=$type;
|
||||
$subarr['version']=$version;
|
||||
$subarr['name']=$file;
|
||||
$subarr['offset']=$offset;
|
||||
$subarr['length']=$length;
|
||||
$toc[]=$subarr;
|
||||
$output.=$binary;
|
||||
}
|
||||
|
||||
$jtoc = json_encode($toc);
|
||||
$tocsize = strlen($jtoc);
|
||||
if($tocsize>$tocmaxsize)die("TOC is too big! adjust size and try again\n");
|
||||
$output = substr_replace($output,$jtoc,0,strlen($jtoc));
|
||||
file_put_contents($binpath."Tag_FW_Pack.bin", $output);
|
||||
print_r($toc);
|
||||
echo "All done.\n";
|
||||
|
||||
Reference in New Issue
Block a user