-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Automatic keyword generation - Adds automatic keyword generation when running build.sh using https://github.com/r89m/arduino-keywords - Updates keywords.txt using the automatic keyword generation - Updates CI to test for correct keywords.txt - Updates dependency installation process * Fix dependencies for dependencies * Install wheel first * Temporarily enable keyword verifcation output * Upgrade pip in deps * Use direct path to arduino-keywords * Use set comparison for keyword verification * Create keywords directory
- Loading branch information
1 parent
416ca46
commit 98b9915
Showing
9 changed files
with
103 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#ignore build files | ||
# Ignore build and dev files | ||
build/ | ||
keywords/ | ||
.vscode/ | ||
|
||
#ignore coverage files | ||
# Ignore coverage files | ||
out/ | ||
*.gch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#make build dir | ||
# Make build dir | ||
rm -r build #for local development | ||
mkdir build | ||
cd build | ||
|
||
#make the project | ||
# Make the project | ||
cmake -DCMAKE_CXX_COMPILER='/usr/bin/avr-gcc' .. | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Dependencies for building | ||
sudo apt-get update | ||
sudo apt-get install gcc lcov gcc-avr binutils-avr avr-libc -y | ||
|
||
# Depdendencies for arduinokeywords | ||
sudo apt-get install python-pip -y | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install arduinokeywords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
BusInOut KEYWORD1 | ||
mode KEYWORD2 | ||
read KEYWORD2 | ||
write KEYWORD2 | ||
Encoder KEYWORD1 | ||
HallEffectEncoder KEYWORD1 | ||
Motor KEYWORD1 | ||
PIDController KEYWORD1 | ||
QuadratureEncoder KEYWORD1 | ||
RLUtil KEYWORD1 | ||
StepperMotor KEYWORD1 | ||
TrackingLoop KEYWORD1 | ||
pullup KEYWORD2 | ||
getTicks KEYWORD2 | ||
getValue KEYWORD2 | ||
process KEYWORD2 | ||
reset KEYWORD2 | ||
HallEffectEncoder KEYWORD1 | ||
begin KEYWORD2 | ||
getTicks KEYWORD2 | ||
getValue KEYWORD2 | ||
begin KEYWORD2 | ||
process KEYWORD2 | ||
reset KEYWORD2 | ||
setDirection KEYWORD2 | ||
reverse KEYWORD2 | ||
setDefaultOnZero KEYWORD2 | ||
output KEYWORD2 | ||
outputBool KEYWORD2 | ||
Motor KEYWORD1 | ||
begin KEYWORD2 | ||
disableOutput KEYWORD2 | ||
enableOutput KEYWORD2 | ||
getNumPins KEYWORD2 | ||
output KEYWORD2 | ||
outputBool KEYWORD2 | ||
reverse KEYWORD2 | ||
setDefaultOnZero KEYWORD2 | ||
PIDController KEYWORD1 | ||
begin KEYWORD2 | ||
getIntegratorValue KEYWORD2 | ||
reset KEYWORD2 | ||
setBounded KEYWORD2 | ||
setIntegratorBounds KEYWORD2 | ||
setOutputRange KEYWORD2 | ||
setTolerance KEYWORD2 | ||
update KEYWORD2 | ||
getIntegratorValue KEYWORD2 | ||
QuadratureEncoder KEYWORD1 | ||
begin KEYWORD2 | ||
getTicks KEYWORD2 | ||
getValue KEYWORD2 | ||
process KEYWORD2 | ||
pullup KEYWORD2 | ||
reset KEYWORD2 | ||
setResolution KEYWORD2 | ||
RLUtil KEYWORD1 | ||
clamp KEYWORD2 | ||
lerp KEYWORD2 | ||
slerp KEYWORD2 | ||
step KEYWORD2 | ||
setRPM KEYWORD2 | ||
StepperMotor KEYWORD1 | ||
begin KEYWORD2 | ||
getCurrentSteps KEYWORD2 | ||
reset KEYWORD2 | ||
setRPM KEYWORD2 | ||
step KEYWORD2 | ||
TrackingLoop KEYWORD1 | ||
getAccelEstimate KEYWORD2 | ||
getPositionEstimate KEYWORD2 | ||
getVelocityEstimate KEYWORD2 | ||
getAccelEstimate KEYWORD2 | ||
setIntegratorBounds KEYWORD2 | ||
setTolerance KEYWORD2 | ||
reset KEYWORD2 | ||
update KEYWORD2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /usr/bin/env python | ||
import os | ||
import sys | ||
|
||
# Run arduino-keywords | ||
os.system("mkdir keywords") | ||
os.system("~/.local/bin/arduino-keywords src --output ../keywords > /dev/null 2>&1") | ||
os.system("sed -i '/operator=/d' keywords/keywords.txt > /dev/null 2>&1") | ||
|
||
# Get a set of the lines from a file | ||
# Using a set to ignore order (as arduino-keyword search order is system dependent) | ||
def get_keywords(filename): | ||
results = set() | ||
with open(filename, "r") as f: | ||
for line in f: | ||
results.add(line) | ||
return results | ||
|
||
# Read both keywords.txt | ||
existing_set = get_keywords("keywords.txt") | ||
new_set = get_keywords("keywords/keywords.txt") | ||
|
||
# Are they the same? | ||
if existing_set != new_set: | ||
print("keywords.txt is not correct. Please run build.sh to generate keywords.txt!") | ||
print("Differences:") | ||
for keyword in existing_set.symmetric_difference(new_set): | ||
print(keyword) | ||
sys.exit(1) |