Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemensElflein committed Oct 4, 2024
1 parent c4f5b8c commit 3b39c0a
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 20 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
push:
branches:
- 'main'
- 'feature/*'

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker Image
run: docker build --output=out .

- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions bootloader/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dep
build
.idea
out
Dockerfile
1 change: 1 addition & 0 deletions bootloader/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake-build-debug/
build/
.dep/
out/
106 changes: 106 additions & 0 deletions bootloader/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions bootloader/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bootloader/.idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bootloader/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions bootloader/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions bootloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:22.04 AS builder
LABEL authors="Clemens Elflein"

RUN apt-get update && apt-get install -y \
gcc-arm-none-eabi \
make \
&& rm -rf /var/lib/apt/lists/*

COPY . /project

WORKDIR /project
RUN make -j$(nproc)


FROM scratch
COPY --from=builder /project/build/xcore-boot.elf /
COPY --from=builder /project/build/xcore-boot.bin /
2 changes: 2 additions & 0 deletions bootloader/build-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker build --output=out .
7 changes: 5 additions & 2 deletions bootloader/main.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// clang-format off
#include "ch.h"
#include "hal.h"
// clang-format on

#include <board_ex.h>
#include <bootloader.h>
#include <globals.h>
#include <heartbeat.h>
#include <id_eeprom.h>
#include <service_discovery.h>

#include "ch.h"
#include "hal.h"
#include "lwipthread.h"

/*
Expand Down
6 changes: 5 additions & 1 deletion bootloader/src/bootloader.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#include "bootloader.h"

// clang-format off
#include "ch.h"
#include "hal.h"
// clang-format on

#include <sha256.h>
#include <stdlib.h>
#include <stm32h7xx_hal.h>

#include "board_ex.h"
#include "ch.h"
#include "chprintf.h"
#include "globals.h"
#include "lwip/sockets.h"
Expand Down
7 changes: 5 additions & 2 deletions bootloader/src/service_discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

#include "service_discovery.h"

// clang-format off
#include "ch.h"
#include "hal.h"
// clang-format on

#include <string.h>

#include "ch.h"
#include "chprintf.h"
#include "hal.h"
#include "lwip/sockets.h"

static char boardAdvertisementBuffer[1000];
Expand Down

0 comments on commit 3b39c0a

Please sign in to comment.