Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -35,7 +35,7 @@ jobs:
make dist

- name: Upload Packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}
path: dist/
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python '3,11'
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
4 changes: 2 additions & 2 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ done
inform "Checking $LIBRARY_NAME $LIBRARY_VERSION\n"

inform "Checking for trailing whitespace..."
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO; then
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.venv --exclude-dir=.git --exclude=PKG-INFO; then
warning "Trailing whitespace found!"
exit 1
else
Expand All @@ -49,7 +49,7 @@ fi
printf "\n"

inform "Checking for DOS line-endings..."
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.venv --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
warning "DOS line-endings found!"
exit 1
else
Expand Down
9 changes: 3 additions & 6 deletions firmware/firmware_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
# Usage: python firmware_update.py filename.hex

import binascii

import sys
import time


from smbus2 import SMBus, i2c_msg


# Small nuvoton:
bootloader_id = 0xB001
bootloader_version = 172
Expand Down Expand Up @@ -108,7 +105,7 @@ def write_page_to_aprom():
try:
i2c_read8(bootloader_i2c_addr, 0x00)
break
except:
except Exception:
print("waiting for page write to finish...")

def read_page_from_aprom():
Expand All @@ -126,7 +123,7 @@ def firmware_update(bin_data, i2c_address, chip_id):

try:
i2c_read8(bootloader_i2c_addr, 0x00)
except:
except Exception:
# We're not in bootloader yet, let's enter first
confirm_id(i2c_address, chip_id)
enter_bootloader(i2c_address)
Expand Down Expand Up @@ -187,7 +184,7 @@ def firmware_update(bin_data, i2c_address, chip_id):


if __name__ == "__main__":
filename = sys.argv[1];
filename = sys.argv[1]
# if bin_filename.endswith(".bin"):
# bin_data = open(bin_filename, "rb").read()
# bin_data = [ord(x) for x in bin_data]
Expand Down
43 changes: 21 additions & 22 deletions firmware/set_i2c_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
# flash write ongoing
# flash write ongoing
# flash write finished
# pi@raspberrypi:~ $
# pi@raspberrypi:~ $
# pi@raspberrypi:~ $
# pi@raspberrypi:~ $
# pi@raspberrypi:~ $ i2cdetect -y 1
# 0 1 2 3 4 5 6 7 8 9 a b c d e f
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 20: -- -- 22 -- -- -- -- -- -- -- -- -- -- -- -- --
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 70: -- -- -- -- -- -- -- --
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 20: -- -- 22 -- -- -- -- -- -- -- -- -- -- -- -- --
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 70: -- -- -- -- -- -- -- --
# pi@raspberrypi:~ $ python set_i2c_address.py 0x22 0x23
# Waiting for flash writing to start..
# flash write ongoing
Expand All @@ -33,26 +33,25 @@
# flash write finished
# pi@raspberrypi:~ $ i2cdetect -y 1
# 0 1 2 3 4 5 6 7 8 9 a b c d e f
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 70: -- -- -- -- -- -- -- --
# 00: -- -- -- -- -- -- -- -- -- -- -- -- --
# 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
# 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# 70: -- -- -- -- -- -- -- --

import time
import os
import sys
import time

import RPi.GPIO as GPIO
from smbus2 import SMBus, i2c_msg

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)

CHIP_ID = 0xBA11
VERSION = 1
VERSION = 1


# Registers specific to the trackball
Expand Down
Loading