Skip to content

Commit

Permalink
build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed May 3, 2024
1 parent 7156e62 commit aa5b22f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 160 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/core_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@ on:
workflow_dispatch: # manual trigger

jobs:
setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history for all branches and tags
- name: Determine Version and Build Number
id: set_version
run: |
# Fetch all tags
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# Get the latest tag that matches the branch suffix
LATEST_TAG=$(git tag --list | grep -E "^[[:digit:]]+\.[[:digit:]]+\$" | sort -V | tail -n1)
if [ -z "$LATEST_TAG" ]; then
echo "No matching tags found. Setting default version."
VERSION_NUMBER="0.1"
BUILD_NUMBER="0"
else
echo "Found latest tag: $LATEST_TAG"
VERSION_NUMBER=$LATEST_TAG
BUILD_NUMBER=$(git rev-list --count $LATEST_TAG..HEAD)
fi
FULL_VERSION="$VERSION_NUMBER.$BUILD_NUMBER"
echo "version=$FULL_VERSION" >> $GITHUB_OUTPUT
echo "Version Number: $FULL_VERSION"
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -18,7 +46,9 @@ jobs:
- name: Install Dependencies
run: sudo apt-get install valgrind g++ make --fix-missing
- name: Build
run: make -j
run: |
VORTEX_BUILD_NUMBER=${{ needs.setup.outputs.version }}
make -j
working-directory: VortexEngine
- name: Set execute permissions for test script
run: chmod +x ./runtests.sh
Expand Down Expand Up @@ -46,6 +76,7 @@ jobs:
- name: Build Webassembly
run: |
source ./emsdk/emsdk_env.sh
VORTEX_BUILD_NUMBER=${{ needs.setup.outputs.version }}
make -j wasm
working-directory: VortexEngine/VortexLib

Expand Down
52 changes: 0 additions & 52 deletions VortexEngine/src/Log/ErrorBlinker.cpp

This file was deleted.

36 changes: 0 additions & 36 deletions VortexEngine/src/Log/ErrorBlinker.h

This file was deleted.

4 changes: 0 additions & 4 deletions VortexEngine/src/Log/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

#include "../VortexConfig.h"

// just self-inclode the error blinker so that anybody who includes log has
// access to the error blinker since it's only enabled in debug builds
#include "../Log/ErrorBlinker.h"

#if LOGGING_LEVEL > 0
#define INFO_LOG(msg) InfoMsg(msg)
#define INFO_LOGF(msg, ...) InfoMsg(msg, __VA_ARGS__)
Expand Down
23 changes: 0 additions & 23 deletions VortexEngine/src/Modes/Modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,35 +387,12 @@ bool Modes::unserialize(ByteStream &modesBuffer)
bool Modes::setDefaults()
{
clearModes();
#if DEMO_ALL_PATTERNS == 1
// RGB_RED, RGB_YELLOW, RGB_GREEN, RGB_CYAN, RGB_BLUE, RGB_PURPLE
PatternID default_start = PATTERN_FIRST;
PatternID default_end = PATTERN_LAST;
// add 65 randomized modes
for (int i = 0; i < 65; ++i) {
Mode tmpMode;
for (LedPos led = LED_FIRST; led < LED_COUNT; ++led) {
// create a random pattern ID from all patterns
PatternID randomPattern = (PatternID)random(PATTERN_SINGLE_FIRST, PATTERN_SINGLE_LAST);
Colorset randSet;
randSet.randomize(8);
tmpMode.setPatternAt(led, randomPattern, nullptr, &randSet);
}
// add another mode with the given pattern and colorset
if (!addMode(&tmpMode)) {
ERROR_LOG("Failed to add mode");
// return false?
}
}
DEBUG_LOGF("Added default patterns %u through %u", default_start, default_end);
#else
// add each default mode with each of the given colors
for (uint8_t i = 0; i < num_default_modes; ++i) {
const default_mode_entry &def = default_modes[i];
Colorset set(def.numColors, def.cols);
addMode(def.patternID, nullptr, &set);
}
#endif
return true;
}

Expand Down
55 changes: 11 additions & 44 deletions VortexEngine/src/VortexConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
// either of the engines on version 1.1 or 1.2
#define VORTEX_VERSION_MINOR 1

// The build or patch number based on the major.minor version, this is
// set by the build system using the number of commits since last version
#ifndef VORTEX_BUILD_NUMBER
#define VORTEX_BUILD_NUMBER 0
#endif

// produces a number like 1.0
#define VORTEX_VERSION_NUMBER VORTEX_VERSION_MAJOR.VORTEX_VERSION_MINOR
#define VORTEX_VERSION_NUMBER VORTEX_VERSION_MAJOR.VORTEX_VERSION_MINOR.VORTEX_BUILD_NUMBER

// produces a string like "1.0"
// produces a string like "1.1.0"
#define ADD_QUOTES(str) #str
#define EXPAND_AND_QUOTE(str) ADD_QUOTES(str)
#define VORTEX_VERSION EXPAND_AND_QUOTE(VORTEX_VERSION_NUMBER)
Expand All @@ -30,7 +36,7 @@

// the full name of this build for ex:
// Vortex Engine v1.0 'Igneous' (built Tue Jan 31 19:03:55 2023)
#define VORTEX_FULL_NAME "Vortex Engine v" VORTEX_VERSION " '" VORTEX_NAME "' ( built " __TIMESTAMP__ ")"
#define VORTEX_FULL_NAME "Vortex Engine v" VORTEX_VERSION " '" VORTEX_NAME "' (built " __TIMESTAMP__ ")"

// Vortex Slim
//
Expand Down Expand Up @@ -307,23 +313,6 @@
// ===================================================================
// Boolean Configurations (0 or 1)

// Fill From Thumb
//
// The ring menu will fill from the thumb if this is present, otherwise
// it will fill from the pinkie.
//
// The logic is cleaner for fill from pinkie but fill from thumb is preferred
#define FILL_FROM_THUMB 1

// Demo All Patterns
//
// The default modes that are set on the gloveset will be dynamically
// generated with one mode per pattern in the patterns list
//
// This can be used to quickly demo all possible patterns, mostly useful
// for testing and development
#define DEMO_ALL_PATTERNS 0

// Debug Allocations
//
// Tracks all memory allocations and logs them, useful for finding leaks
Expand All @@ -349,25 +338,6 @@
// the final build? I'm not sure.
#define VARIABLE_TICKRATE 0

// Error Blinker System
//
// This toggles the vortex error blinker system, this system reports
// fatal errors as a series of blinks. If an error is encountered the
// chip will only blink out the error code from there forward.
//
// Note that enabling this system takes a non-negligible amount
// of space for all of the code, it really should only be used
// for debug settings or given tiers like logging level.
//
// This is mainly useful for tracking down issues on devices that don't
// have a serial connection like the attiny. Use FATAL_ERROR(code) to
// set the error code and then the device will blink out the error
//
// for ex: red red green blue blue blue is code 213
//
// See Log/ErrorBlinker.h for details on the error codes
#define VORTEX_ERROR_BLINK 0

// Fixed LED Count
//
// Do not allow the Mode loader to dynamically load however many modes
Expand Down Expand Up @@ -592,11 +562,8 @@

#endif // VortexEditor

// When running in the test framework with demo all patterns enabled
// we should change the max patterns to the total pattern count because
// the test framework can handle the memory usage and we can't demo
// all the patterns without the increased limit
#if DEMO_ALL_PATTERNS == 1 || SERIALIZATION_TEST == 1 || COMPRESSION_TEST == 1
// When running various tests lift the max mode limit and enable logging
#if SERIALIZATION_TEST == 1 || COMPRESSION_TEST == 1
#undef MAX_MODES
#include "Patterns/Patterns.h"
#define MAX_MODES 0
Expand Down

0 comments on commit aa5b22f

Please sign in to comment.