Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Firmware #6

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 43 additions & 20 deletions .github/workflows/hardware_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,40 @@ on:
pull_request:
paths:
- "Hardware/**"
# - ".github/**"

jobs:
KiCad_Hardware:
runs-on: ubuntu-latest
name: KiCad Hardware
name: SuperButton Hardware

strategy:
matrix:
variant:
- SuperButtonX1
- SuperButtonX3

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- uses: INTI-CMNB/KiBot@v2_k7
with:
# Config file
config: Hardware/config.kibot.yaml
config: Hardware/${{ matrix.variant }}.yaml
# Prefix for output in config file.
dir: _hardwareOutput

# Hardware Files
schema: "Hardware/SuperButton/SuperButton.kicad_sch"
board: "Hardware/SuperButton/SuperButton.kicad_pcb"
schema: "Hardware/${{ matrix.variant }}/${{ matrix.variant }}.kicad_sch"
board: "Hardware/${{ matrix.variant }}/${{ matrix.variant }}.kicad_pcb"

- name: upload results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Board-Hardware
name: ${{ matrix.variant }}
path: _hardwareOutput

- name: Discord notification if failed
Expand All @@ -58,7 +65,7 @@ jobs:
# python-version: "3.10"
# architecture: x64

# - uses: actions/checkout@v2
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0

Expand All @@ -70,7 +77,7 @@ jobs:
# run: pip install -r Docs/requirements.txt

# # Download artifacts from other builds
# - uses: actions/download-artifact@v2
# - uses: actions/download-artifact@v3
# with:
# name: Board-Hardware
# path: _hardwareOutput
Expand All @@ -82,7 +89,7 @@ jobs:

# - run: mv Docs/_build/latex/*.pdf Docs/_build/latex/Board-Manual.pdf

# - uses: actions/upload-artifact@v2
# - uses: actions/upload-artifact@v3
# with:
# name: Board-Manual
# path: Docs/_build/latex/Board-Manual.pdf
Expand All @@ -94,15 +101,21 @@ jobs:
# needs: [make_docs, KiCad_Hardware]
needs: [KiCad_Hardware]

strategy:
matrix:
variant:
- SuperButtonX1
- SuperButtonX3

steps:
# Download artifacts
# - uses: actions/download-artifact@v2
# - uses: actions/download-artifact@v3
# with:
# name: Board-Manual

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Board-Hardware
name: ${{ matrix.variant }}

# - name: send custom message with args
# uses: appleboy/discord-action@master
Expand All @@ -117,7 +130,8 @@ jobs:
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
file: "SuperButton-3D_top.png"
file: "${{ matrix.variant }}-3D_top.png"
args: ${{ matrix.variant }}

publish:
# Only run on tags
Expand All @@ -127,20 +141,26 @@ jobs:
# needs: [make_docs, KiCad_Hardware]
needs: [KiCad_Hardware]

strategy:
matrix:
variant:
- SuperButtonX1
- SuperButtonX3

steps:
# Be in our repo
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

# Download artifacts
# - uses: actions/download-artifact@v2
# - uses: actions/download-artifact@v3
# with:
# name: Board-Manual

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Board-Hardware
name: ${{ matrix.variant }}

- run: mkdir -p _staging/

Expand All @@ -149,8 +169,11 @@ jobs:
- run: cp *.step _staging/

# Copy gerbers
- run: cp PCBWay/*.zip _staging/Board-$(git rev-parse --short HEAD)-PCBWay.zip
- run: cp JLCPCB/*.zip _staging/Board-$(git rev-parse --short HEAD)-JLCPCB.zip
- run: cp PCBWay/*.zip _staging/${{ matrix.variant }}-$(git rev-parse --short HEAD)-PCBWay.zip
- run: cp JLCPCB/*.zip _staging/${{ matrix.variant }}-$(git rev-parse --short HEAD)-JLCPCB.zip

# Copy BOMs
- run: cp *.csv _staging/

- name: Upload Docs to release
uses: svenstaro/upload-release-action@v2
Expand Down
24 changes: 18 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
[submodule "Hardware/SuperButton/Libraries/1721-kicad-libraries"]
path = Hardware/SuperButton/Libraries/1721-kicad-libraries
[submodule "Hardware/SuperButtonX1/Libraries/1721-kicad-libraries"]
path = Hardware/SuperButtonX1/Libraries/1721-kicad-libraries
url = https://github.com/FRC-1721/1721-kicad-libraries
[submodule "Hardware/SuperButton/Libraries/keyswitch-kicad-library"]
path = Hardware/SuperButton/Libraries/keyswitch-kicad-library
[submodule "Hardware/SuperButtonX1/Libraries/keyswitch-kicad-library"]
path = Hardware/SuperButtonX1/Libraries/keyswitch-kicad-library
url = https://github.com/perigoso/keyswitch-kicad-library.git
[submodule "Hardware/SuperButton/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/SuperButton/Libraries/kenwoodfox-kicad-libraries
[submodule "Hardware/SuperButtonX1/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/SuperButtonX1/Libraries/kenwoodfox-kicad-libraries
url = https://github.com/KenwoodFox/kenwoodfox-kicad-libraries.git
[submodule "Hardware/SuperButtonX3/Libraries/1721-kicad-libraries"]
path = Hardware/SuperButtonX3/Libraries/1721-kicad-libraries
url = https://github.com/FRC-1721/1721-kicad-libraries
[submodule "Hardware/SuperButtonX3/Libraries/keyswitch-kicad-library"]
path = Hardware/SuperButtonX3/Libraries/keyswitch-kicad-library
url = https://github.com/perigoso/keyswitch-kicad-library.git
[submodule "Hardware/SuperButtonX3/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/SuperButtonX3/Libraries/kenwoodfox-kicad-libraries
url = https://github.com/KenwoodFox/kenwoodfox-kicad-libraries.git
[submodule "Firmware/lib/4xMacropad"]
path = Firmware/lib/4xMacropad
url = https://github.com/tobychui/4xMacropad.git
2 changes: 2 additions & 0 deletions Firmware/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.pio
.vscode/*
26 changes: 9 additions & 17 deletions Firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,22 @@ endif

ALL: build

configure:
#arduino-cli config init
arduino-cli config set library.enable_unsafe_install true
arduino-cli core install CH55xDuino:mcs51 --additional-urls https://raw.githubusercontent.com/DeqingSun/ch55xduino/ch55xduino/package_ch55xduino_mcs51_index.json
arduino-cli lib install --git-url https://github.com/atc1441/CH_HID_Arduino.git

build:
pio run
arduino-cli compile --fqbn CH55xDuino:mcs51:ch552 src

# For CI
binaries:
pio run
pio run -t .pio/build/attiny85/firmware.eep

flash:
pio run -t upload

deep:
pio run -t uploadeep
arduino-cli upload -p $(SERIAL_DEV) --fqbn CH55xDuino:mcs51:ch552 src

clean:
pio run -t clean

lint:
pio check

test:
pio test --upload-port $(SERIAL_DEV)

debug: flash monitor

monitor:
pio device monitor --filter=direct --filter=time
git clean -fdX
21 changes: 21 additions & 0 deletions Firmware/boards/CH552.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"build": {
"extra_flags": "--model=small -DFREQ_SYS=12000000",
"f_cpu": "12000000L",
"size_iram": 256,
"size_xram": 1024,
"size_code": 16384,
"size_heap": 128,
"mcu": "ch552",
"cpu": "mcs51"
},
"frameworks": [],
"upload": {
"maximum_ram_size": 900,
"maximum_size": 16000,
"protocol": "ch55x"
},
"name": "CH552",
"url": "http://www.wch-ic.com/products/CH552.html",
"vendor": "WCH"
}
15 changes: 0 additions & 15 deletions Firmware/include/boardPins.h

This file was deleted.

14 changes: 0 additions & 14 deletions Firmware/platformio.ini

This file was deleted.

18 changes: 0 additions & 18 deletions Firmware/src/main.cpp

This file was deleted.

34 changes: 34 additions & 0 deletions Firmware/src/src.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Super button source code
* by 1721 Tidal Force!
*/

#include "CH_HID_Arduino.h"

#define CH_RESET_PIN 6

void setup()
{
Serial.begin(57600);
ch_hid.begin(&Serial, CH_RESET_PIN); // Both args not needed, will default to Serial and no CH55x reset

Keyboard.print("Hallo");

delay(1000);

Keyboard.press(KEY_LEFT_ARROW);
Keyboard.release(KEY_LEFT_ARROW);
// Keyboard.releaseAll();

// Mouse.click(MOUSE_LEFT); // Click Mouse button
// Mouse.move(0, -40); // Move mouse X Y
// Mouse.move(0, 0, 3); // Mouse wheel plus 3
// Mouse.move(0, 0, -3); // Mouse wheel minus 3

// ch_hid.reset();
// ch_hid.bootloader();
}

void loop()
{
// nothing to do here.
}
1 change: 1 addition & 0 deletions Hardware/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.*-bak
*.*-backups
File renamed without changes.
Loading