Compare commits
3 commits
stable
...
jedi/dev/s
Author | SHA1 | Date | |
---|---|---|---|
afa011b50e | |||
5abdb22c54 | |||
60c642bc15 |
12 changed files with 1168475 additions and 66 deletions
|
@ -9,19 +9,17 @@ steps:
|
|||
- name: submodules
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git submodule update --init --recursive --depth 1
|
||||
- git submodule update --init --recursive
|
||||
|
||||
- name: firmware
|
||||
image: docker-repo.service.intern.lab.or.it:5000/fiatlux-build-env
|
||||
depends_on: [ submodules ]
|
||||
commands:
|
||||
- export PATH=$(pwd)/modules/sdk/xtensa-lx106-elf/bin:$PATH
|
||||
- apt update
|
||||
- apt install -y minify
|
||||
- make firmware -j$(nproc)
|
||||
|
||||
- name: pcb
|
||||
image: setsoft/kicad_auto:ki6
|
||||
image: setsoft/kicad_auto
|
||||
commands:
|
||||
- apt update
|
||||
- apt install -y make zip
|
||||
|
@ -64,6 +62,6 @@ steps:
|
|||
checksum:
|
||||
- sha512
|
||||
- md5
|
||||
title: fiatlux
|
||||
title: buildtest
|
||||
when:
|
||||
event: tag
|
||||
|
|
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,6 +1,6 @@
|
|||
[submodule "modules/rtos"]
|
||||
path = modules/rtos
|
||||
url = https://git.neulandlabor.de/j3d1/esp-open-rtos.git
|
||||
url = https://github.com/SuperHouse/esp-open-rtos.git
|
||||
[submodule "modules/sdk"]
|
||||
path = modules/sdk
|
||||
url = https://github.com/pfalcon/esp-open-sdk.git
|
||||
|
|
6
Makefile
6
Makefile
|
@ -1,3 +1,4 @@
|
|||
|
||||
.PHONY: firmware flash firmware_docker case pcb
|
||||
|
||||
all: firmware case pcb
|
||||
|
@ -18,11 +19,6 @@ clean:
|
|||
+@make -C firmware clean
|
||||
+@make -C pcb clean
|
||||
|
||||
flash_docker:
|
||||
sh -c "docker build -t fiatlux_firmware_env docker/firmware"
|
||||
sh -c "docker run --volume "$$(pwd)"/firmware:/app/firmware --device=/dev/ttyUSB0 fiatlux_firmware_env make -C firmware flash"
|
||||
|
||||
|
||||
firmware_docker:
|
||||
sh -c "docker build -t fiatlux_firmware_env docker/firmware"
|
||||
sh -c "docker run --volume "$$(pwd)"/firmware:/app/firmware fiatlux_firmware_env make -C firmware html all"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
PROGRAM=fiatlux
|
||||
|
||||
EXTRA_CFLAGS=-O3 -Ibuild/gen -DLWIP_NETIF_HOSTNAME=1
|
||||
EXTRA_CFLAGS=-O3 -Ibuild/gen
|
||||
|
||||
EXTRA_COMPONENTS=extras/i2s_dma extras/ws2812_i2s extras/dhcpserver extras/rboot-ota extras/mbedtls extras/httpd extras/sntp extras/cpp_support extras/paho_mqtt_c
|
||||
EXTRA_COMPONENTS=extras/i2s_dma extras/ws2812_i2s extras/dhcpserver extras/rboot-ota extras/mbedtls extras/httpd extras/sntp extras/cpp_support
|
||||
|
||||
LIBS = hal m
|
||||
|
||||
FLASH_MODE = qio
|
||||
FLASH_MODE = dio
|
||||
|
||||
include ../modules/rtos/common.mk
|
||||
|
||||
|
@ -15,7 +15,7 @@ html: build/gen/fsdata.c
|
|||
build/gen/fsdata.c: webdir/index.html webdir/404.html webdir/css/picnic.min.css webdir/css/style.css webdir/js/smoothie_min.js
|
||||
@echo "Generating fsdata.."
|
||||
@mkdir -p $(dir $@)
|
||||
@./mkwebfs.py --gzip --minify -o $@ $^
|
||||
@./mkwebfs.py --gzip -o $@ $^
|
||||
|
||||
test: unittest systest
|
||||
|
||||
|
|
1168411
firmware/livc.s
Normal file
1168411
firmware/livc.s
Normal file
File diff suppressed because it is too large
Load diff
|
@ -33,6 +33,8 @@ unsigned syslog_data_after(unsigned local_tail) {
|
|||
|
||||
extern "C" int syslog_copy_out(char *out, int len, unsigned local_tail) {
|
||||
unsigned cnt = 0;
|
||||
// printf("<syslog(%d): [%d, %d] `%.*s`\n", streams, (local_tail & syslog_buffer_size), head,
|
||||
// head - (local_tail & syslog_buffer_size), &syslog_buf[local_tail % syslog_buffer_size]);
|
||||
while (cnt < syslog_data_after(local_tail) && cnt < len) {
|
||||
out[cnt] = syslog_buf[local_tail % syslog_buffer_size + cnt];
|
||||
cnt++;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import os
|
||||
import gzip
|
||||
import argparse
|
||||
import subprocess
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-o', '--output', help='Output file name', default='stdout')
|
||||
|
@ -10,9 +9,6 @@ parser.add_argument('-W', '--webroot', help='Output file name', default='webdir/
|
|||
parser.add_argument('--gzip', dest='gzip', action='store_true')
|
||||
parser.add_argument('--no-gzip', dest='gzip', action='store_false')
|
||||
parser.set_defaults(gzip=False)
|
||||
parser.add_argument('--minify', dest='minify', action='store_true')
|
||||
parser.add_argument('--no-minify', dest='minify', action='store_false')
|
||||
parser.set_defaults(minify=False)
|
||||
parser.add_argument('--header', dest='header', action='store_true')
|
||||
parser.add_argument('--no-header', dest='header', action='store_false')
|
||||
parser.set_defaults(header=True)
|
||||
|
@ -20,31 +16,6 @@ parser.add_argument('input', nargs='+', default=os.getcwd())
|
|||
args = parser.parse_args()
|
||||
|
||||
|
||||
def mimeFromName(name):
|
||||
if name.endswith(".html") or name.endswith(".htm") or name.endswith(".shtml") or name.endswith(
|
||||
".shtm") or name.endswith(".ssi"):
|
||||
return "text/html"
|
||||
if name.endswith(".js"):
|
||||
return "application/x-javascript"
|
||||
if name.endswith(".css"):
|
||||
return "text/css"
|
||||
if name.endswith(".ico"):
|
||||
return "image/x-icon"
|
||||
if name.endswith(".gif"):
|
||||
return "image/gif"
|
||||
if name.endswith(".png"):
|
||||
return "image/png"
|
||||
if name.endswith(".jpg"):
|
||||
return "image/jpeg"
|
||||
if name.endswith(".bmp"):
|
||||
return "image/bmp"
|
||||
if name.endswith(".class"):
|
||||
return "application/octet-stream"
|
||||
if name.endswith(".ram"):
|
||||
return "audio/x-pn-realaudio"
|
||||
return "text/plain"
|
||||
|
||||
|
||||
def dumpBin2CHex(f, b):
|
||||
oStr = "\t"
|
||||
n = 0
|
||||
|
@ -70,28 +41,40 @@ for file in httpFiles:
|
|||
webPath = ("/" + file.removeprefix(args.webroot)).replace("//", "/")
|
||||
print("{} > {}".format(file, webPath))
|
||||
|
||||
mimeType = mimeFromName(file)
|
||||
|
||||
if args.header:
|
||||
if ("404" in file):
|
||||
response = b'HTTP/1.0 404 File not found\r\n'
|
||||
else:
|
||||
response = b'HTTP/1.0 200 OK\r\n'
|
||||
response += b"lwIP/1.4.1 (http://savannah.nongnu.org/projects/lwip)\r\n"
|
||||
response += b'Content-type: ' + mimeType.encode() + b'\r\n'
|
||||
fext = file.split('.')[-1]
|
||||
ctype = b'Content-type: text/plain\r\n'
|
||||
if (fext.endswith("html") or fext.endswith("htm") or fext.endswith("shtml") or fext.endswith(
|
||||
"shtm") or fext.endswith("ssi")):
|
||||
ctype = b'Content-type: text/html\r\n'
|
||||
if (fext.endswith("js")):
|
||||
ctype = b'Content-type: application/x-javascript\r\n'
|
||||
if (fext.endswith("css")):
|
||||
ctype = b'Content-type: text/css\r\n'
|
||||
if (fext.endswith("ico")):
|
||||
ctype = b'Content-type: image/x-icon\r\n'
|
||||
if (fext.endswith("gif")):
|
||||
ctype = b'Content-type: image/gif\r\n'
|
||||
if (fext.endswith("png")):
|
||||
ctype = b'Content-type: image/png\r\n'
|
||||
if(fext.endswith("jpg")):
|
||||
ctype = b'Content-type: image/jpeg\r\n'
|
||||
if(fext.endswith("bmp")):
|
||||
ctype = b'Content-type: image/bmp\r\n'
|
||||
if(fext.endswith("class")):
|
||||
ctype = b'Content-type: application/octet-stream\r\n'
|
||||
if(fext.endswith("ram")):
|
||||
ctype = b'Content-type: audio/x-pn-realaudio\r\n'
|
||||
response += ctype
|
||||
|
||||
binFile = open(file, 'rb')
|
||||
binData = binFile.read()
|
||||
compEff = False
|
||||
if args.minify:
|
||||
p = subprocess.Popen(["minify", "--html-keep-document-tags", "--mime", mimeType], stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE)
|
||||
minData = p.communicate(binData)[0]
|
||||
if len(minData) < len(binData):
|
||||
print("- Minify: {} -> {}".format(len(binData), len(minData)))
|
||||
compEff = True
|
||||
binData = minData
|
||||
|
||||
if args.gzip:
|
||||
compData = gzip.compress(binData, 9)
|
||||
if len(compData) < len(binData):
|
||||
|
@ -120,8 +103,7 @@ for file in httpFiles:
|
|||
f_fsdata_c.write("};\n\n")
|
||||
|
||||
f_fsdata_c.write("const struct fsdata_file {}[] = {{{{\n {},\n {}, {} + {}, sizeof({}) - {}, 1 }}}};\n\n"
|
||||
.format(escFileFile, lastFileStruct, escFileData, escFileData, len(fnameBin), escFileData,
|
||||
len(fnameBin)))
|
||||
.format(escFileFile, lastFileStruct, escFileData, escFileData, len(fnameBin), escFileData, len(fnameBin)))
|
||||
# TODO: The last value is 1 if args.header == True
|
||||
lastFileStruct = escFileFile
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <spiflash.h>
|
||||
|
||||
#include <espressif/user_interface.h>
|
||||
#include <esp/uart.h>
|
||||
#include <espressif/esp_system.h>
|
||||
#include <rboot/rboot.h>
|
||||
#include <rboot-ota/rboot-api.h>
|
||||
|
@ -49,6 +50,20 @@ void system_init_config() {
|
|||
}
|
||||
}
|
||||
|
||||
int fputc(int ch, FILE *f)
|
||||
{
|
||||
uart_putc(0, '0');
|
||||
uart_putc(0, ch);
|
||||
return ch;
|
||||
}
|
||||
|
||||
int puts (const char *str)
|
||||
{
|
||||
char c;
|
||||
while((c=*str++))fputc(c,0);
|
||||
return str;
|
||||
}
|
||||
|
||||
#define MAX_IMAGE_SIZE 0x100000
|
||||
|
||||
struct {
|
||||
|
|
|
@ -337,3 +337,13 @@ extern "C" void httpd_task(void *pvParameters) {
|
|||
|
||||
vTaskDelete(nullptr);
|
||||
}
|
||||
|
||||
#include <stdio.h>
|
||||
#include <espressif/esp_common.h>
|
||||
|
||||
void test(){
|
||||
|
||||
printf("foo\n");
|
||||
printf("Warning: WiFi config, sysparam not initialized\n");
|
||||
printf("SDK version: %s\n", sdk_system_get_sdk_version());
|
||||
};
|
|
@ -1 +1 @@
|
|||
Subproject commit 7faa16b07ce0d606f9525a316990da5b58e61314
|
||||
Subproject commit 503e66a500419e8863998b7ea784c5e26a7a5f7c
|
4
pcb/.gitignore
vendored
4
pcb/.gitignore
vendored
|
@ -31,8 +31,6 @@ fp-info-cache
|
|||
*.wrl
|
||||
*.step
|
||||
|
||||
*-backups/
|
||||
*-bak
|
||||
gen/
|
||||
pcb.zip
|
||||
|
||||
report.txt
|
3
webapp/.gitignore
vendored
3
webapp/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
node_modules/
|
||||
src/gen/
|
||||
package-lock.json
|
Loading…
Reference in a new issue