-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Unreal-Dan/daniel/space_cleanup
cleaned up some space and refined some things
Showing
12 changed files
with
354 additions
and
374 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Helios Build | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
workflow_dispatch: # manual trigger | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v3 | ||
- name: Update Package Lists | ||
run: sudo apt-get update | ||
- name: Install Dependencies | ||
run: sudo apt-get install valgrind g++ make --fix-missing | ||
- name: Build | ||
run: make -j | ||
working-directory: HeliosCLI | ||
- name: Set execute permissions for test script | ||
run: chmod +x ./runtests.sh | ||
working-directory: tests | ||
- name: Run general tests | ||
run: ./runtests.sh | ||
working-directory: tests | ||
|
||
embedded: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install Dependencies | ||
run: make install | ||
- name: Build Binary | ||
run: make build | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: embedded firmware | ||
path: | | ||
helios.bin | ||
helios.elf | ||
helios.map | ||
helios.hex |
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
#ifndef COLORSET_H | ||
#define COLORSET_H | ||
|
||
#include "ColorTypes.h" | ||
#include "Colortypes.h" | ||
|
||
#include "HeliosConfig.h" | ||
|
||
|
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
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
#include <inttypes.h> | ||
|
||
#include "ColorTypes.h" | ||
#include "Colortypes.h" | ||
|
||
class Led | ||
{ | ||
|
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,46 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# need megatinycore installed for this | ||
|
||
if [ "$(uname -o)" == "Msys" ]; then | ||
AVR_SIZE="C:/Program Files (x86)/Atmel/Studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/avr-size.exe" | ||
else | ||
AVR_SIZE="${HOME}/atmel_setup/avr8-gnu-toolchain-linux_x86_64/bin/avr-size" | ||
fi | ||
|
||
# Replace this with the path to your .elf file | ||
ELF_FILE=$1 | ||
|
||
if [ "$ELF_FILE" == "" ]; then | ||
echo "Please specify a file: $0 <file>" | ||
exit 1 | ||
fi | ||
|
||
# Constants for program storage and dynamic memory size | ||
PROGRAM_STORAGE=8192 | ||
DYNAMIC_MEMORY=512 | ||
|
||
# Run avr-size and parse the output | ||
if [ "$(uname -o)" == "Msys" ]; then | ||
OUTPUT=$("$AVR_SIZE" -A $ELF_FILE) | ||
else | ||
OUTPUT=$($AVR_SIZE -A $ELF_FILE) | ||
fi | ||
|
||
# Extract sizes of .text, .data, .rodata, and .bss sections | ||
TEXT_SIZE=$(echo "$OUTPUT" | grep -E '\.text' | awk '{print $2}') | ||
DATA_SIZE=$(echo "$OUTPUT" | grep -E '\.data' | awk '{print $2}') | ||
RODATA_SIZE=$(echo "$OUTPUT" | grep -E '\.rodata' | awk '{print $2}') | ||
BSS_SIZE=$(echo "$OUTPUT" | grep -E '\.bss' | awk '{print $2}') | ||
|
||
# Calculate used program storage and dynamic memory | ||
PROGRAM_STORAGE_USED=$((TEXT_SIZE + DATA_SIZE + RODATA_SIZE)) | ||
DYNAMIC_MEMORY_USED=$((DATA_SIZE + BSS_SIZE)) | ||
|
||
# Calculate percentages | ||
PROGRAM_STORAGE_PERCENT=$(awk -v used="$PROGRAM_STORAGE_USED" -v total="$PROGRAM_STORAGE" 'BEGIN { printf("%.2f", used / total * 100) }') | ||
DYNAMIC_MEMORY_PERCENT=$(awk -v used="$DYNAMIC_MEMORY_USED" -v total="$DYNAMIC_MEMORY" 'BEGIN { printf("%.2f", used / total * 100) }') | ||
|
||
# Display the results | ||
echo "Sketch uses $PROGRAM_STORAGE_USED bytes ($PROGRAM_STORAGE_PERCENT%) of program storage space. Maximum is $PROGRAM_STORAGE bytes. (Hex: $(printf '%x' $PROGRAM_STORAGE_USED)/$(printf '%x' $PROGRAM_STORAGE))" | ||
echo "Global variables use $DYNAMIC_MEMORY_USED bytes ($DYNAMIC_MEMORY_PERCENT%) of dynamic memory, leaving $(($DYNAMIC_MEMORY - $DYNAMIC_MEMORY_USED)) bytes for local variables. Maximum is $DYNAMIC_MEMORY bytes. (Hex: $(printf '%x' $DYNAMIC_MEMORY_USED)/$(printf '%x' $DYNAMIC_MEMORY))" | ||
#!/bin/bash | ||
|
||
# need megatinycore installed for this | ||
|
||
if [ "$OS" == "Windows_NT" ]; then | ||
AVR_SIZE="C:/Program Files (x86)/Atmel/Studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/avr-size.exe" | ||
elif [ "$(uname -s)" == "Linux" ]; then | ||
AVR_SIZE="${HOME}/atmel_setup/avr8-gnu-toolchain-linux_x86_64/bin/avr-size" | ||
else | ||
AVR_SIZE="/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-size" | ||
fi | ||
|
||
if [ ! -x $AVR_SIZE ]; then | ||
echo "Could not find avr-size program" | ||
exit 1 | ||
fi | ||
|
||
# Replace this with the path to your .elf file | ||
ELF_FILE=$1 | ||
|
||
if [ "$ELF_FILE" == "" ]; then | ||
echo "Please specify a file: $0 <file>" | ||
exit 1 | ||
fi | ||
|
||
# Constants for program storage and dynamic memory size | ||
PROGRAM_STORAGE=8192 | ||
DYNAMIC_MEMORY=512 | ||
|
||
# Run avr-size and parse the output | ||
if [ "$(uname -o)" == "Msys" ]; then | ||
OUTPUT=$("$AVR_SIZE" -A $ELF_FILE) | ||
else | ||
OUTPUT=$($AVR_SIZE -A $ELF_FILE) | ||
fi | ||
|
||
# Extract sizes of .text, .data, .rodata, and .bss sections | ||
TEXT_SIZE=$(echo "$OUTPUT" | grep -E '\.text' | awk '{print $2}') | ||
DATA_SIZE=$(echo "$OUTPUT" | grep -E '\.data' | awk '{print $2}') | ||
RODATA_SIZE=$(echo "$OUTPUT" | grep -E '\.rodata' | awk '{print $2}') | ||
BSS_SIZE=$(echo "$OUTPUT" | grep -E '\.bss' | awk '{print $2}') | ||
|
||
# Calculate used program storage and dynamic memory | ||
PROGRAM_STORAGE_USED=$((TEXT_SIZE + DATA_SIZE + RODATA_SIZE)) | ||
DYNAMIC_MEMORY_USED=$((DATA_SIZE + BSS_SIZE)) | ||
|
||
# Calculate percentages | ||
PROGRAM_STORAGE_PERCENT=$(awk -v used="$PROGRAM_STORAGE_USED" -v total="$PROGRAM_STORAGE" 'BEGIN { printf("%.2f", used / total * 100) }') | ||
DYNAMIC_MEMORY_PERCENT=$(awk -v used="$DYNAMIC_MEMORY_USED" -v total="$DYNAMIC_MEMORY" 'BEGIN { printf("%.2f", used / total * 100) }') | ||
|
||
# Display the results | ||
echo "Sketch uses $PROGRAM_STORAGE_USED bytes ($PROGRAM_STORAGE_PERCENT%) of program storage space. Maximum is $PROGRAM_STORAGE bytes. (Hex: $(printf '%x' $PROGRAM_STORAGE_USED)/$(printf '%x' $PROGRAM_STORAGE))" | ||
echo "Global variables use $DYNAMIC_MEMORY_USED bytes ($DYNAMIC_MEMORY_PERCENT%) of dynamic memory, leaving $(($DYNAMIC_MEMORY - $DYNAMIC_MEMORY_USED)) bytes for local variables. Maximum is $DYNAMIC_MEMORY bytes. (Hex: $(printf '%x' $DYNAMIC_MEMORY_USED)/$(printf '%x' $DYNAMIC_MEMORY))" |
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,3 @@ | ||
#!/bin/bash | ||
|
||
echo "Success! All tests completed successfully" |