Skip to content

Commit

Permalink
Merge branch 'edge-preview' of https://github.com/synthetos/g2 into e…
Browse files Browse the repository at this point in the history
…dge-preview
  • Loading branch information
ril3y committed Jul 16, 2023
2 parents 89aad4a + 3b0d92f commit aad2b78
Show file tree
Hide file tree
Showing 15 changed files with 867 additions and 244 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build_g2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C/C++ CI
name: Build G2

on:
push:
Expand All @@ -10,19 +10,21 @@ on:
# branches:

jobs:
checkout:
name: checkout the repo with submodules
Build:
name: Checkout and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Cache Tools
id: cache-tools
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ./Motate/Tools/linux
key: ${{ runner.os }}-tools-02 # Change the number to invalidate the tools caches
key: ${{ runner.os }}-tools-03 # Change the number to invalidate the tools caches

- name: prepare
working-directory: ${{ github.workspace }}/g2core/
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"request": "launch",
"servertype": "jlink",
"cwd": "${workspaceRoot}/g2core/",
"executable": "./bin/r7-gquintic-d/g2core.elf",
"device": "ATSAMS70N19",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N19.svd",
"executable": "./bin/r7-gquintic-g/g2core.elf",
"device": "ATSAMS70N20",
"svdFile": "${workspaceRoot}/Motate/MotateProject/motate/cmsis/TARGET_Atmel/sams70/ATSAMS70N20B.svd",
"interface": "swd",
"showDevDebugOutput": "none",
"osx": {
Expand Down
44 changes: 44 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Use a Debian-based image as a parent image
FROM debian:buster-slim

# Install build-essential, git, and uucp
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git wget xz-utils uucp bossa-cli

# Set the working directory to /app
WORKDIR /app

# Clone the g2 GitHub repo
RUN git clone https://github.com/synthetos/g2.git && \
cd g2 && \
git submodule init && \
git submodule update

RUN mkdir -p /app/g2/Motate/Tools/linux && \
wget -P /app/g2/Motate/Tools/linux https://github.com/synthetos/gcc-arm-none-eabi-archive/releases/download/12.2.Rel1/arm-gnu-toolchain-12.2.rel1-linux-x86_64-arm-none-eabi.tar.xz



#Extract the toolchain archive to the directory

RUN cd /app/g2/Motate/Tools/linux && \
tar xf arm-gnu-toolchain-12.2.rel1-linux-x86_64-arm-none-eabi.tar.xz && \
rm -f "arm-gnu-toolchain-12.2.rel1-linux-x86_64-arm-none-eabi.tar.xz"

RUN apt-get install dos2unix

# Set the TERM environment variable
ENV TERM=xterm

# Set the working directory to the cloned repo directory
WORKDIR /app/g2/g2core

# Create a volume for storing build output
VOLUME /app/g2/g2core/bin

COPY entrypoint.sh /app/entrypoint.sh
RUN dos2unix /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]


# Define the default command to run the build
#CMD ["BOARD=gShield", "SETTINGS=default_settings.h"]
28 changes: 28 additions & 0 deletions Docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e


if [ "$1" == "--build" ]; then
BOARD="$2"
SETTINGS="$3"
if [ -z "$2" ] || [ -z "$3" ]; then
echo "Usage: $0 --build BOARD SETTING"
exit 1
fi

if [ ! -f "/app/g2/g2core/settings/$SETTINGS" ]; then
echo "Error: Settings file not found: /g2/g2core/settings/$SETTINGS"
exit 1
fi




echo "Building g2core for board $BOARD with setting $SETTINGS"
echo "Build started in 5 seconds..."
sleep 5
cd /app/g2/g2core
make BOARD="$BOARD" SETTINGS_FILE="$SETTINGS"
fi

2 changes: 1 addition & 1 deletion Motate
10 changes: 0 additions & 10 deletions g2core.xcworkspace/contents.xcworkspacedata

This file was deleted.

7 changes: 7 additions & 0 deletions g2core/boards.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ ifeq ("$(CONFIG)","MiniMillrevD")
SETTINGS_FILE="settings_minimill.h"
endif

ifeq ("$(CONFIG)","EnderLaser")
ifeq ("$(BOARD)","NONE")
BOARD=gquintic-g
endif
SETTINGS_FILE="settings_ender_laser.h"
endif

ifeq ("$(CONFIG)","MiniMill")
ifeq ("$(BOARD)","NONE")
BOARD=gquintic-g
Expand Down
Loading

0 comments on commit aad2b78

Please sign in to comment.