Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
727636d
Add PDPWOPR project. PDPCMX effect
davepl Aug 5, 2025
fad5ad6
Clean up project, fix S3 screen crash
davepl Aug 6, 2025
f6f2068
Fix non-working python script dependency
davepl Aug 6, 2025
ca412f6
Interim work on platformio.ini refactor
davepl Aug 6, 2025
06edf0e
Fix audio break
davepl Aug 6, 2025
e23d3c6
Fix audio issue with elecrow mesmerizer
davepl Aug 6, 2025
fb1fb79
Add libdeps, effects to mesmerizer
davepl Aug 7, 2025
8e0a5b4
Merge branch 'pdpwopr' of github.com:PlummersSoftwareLLC/NightDriverS…
davepl Aug 7, 2025
cc243da
Fix partition table for mesmerizer
davepl Aug 7, 2025
264f500
Build fixes
davepl Aug 7, 2025
9e3fa75
Make them all build
davepl Aug 7, 2025
05ae704
Before lib_deps
davepl Aug 7, 2025
6146dc9
Remove redundant libs
davepl Aug 7, 2025
a159aa3
Move MESMERIZER out of globals as a test
davepl Aug 7, 2025
44852e8
Migrate globals to platformio
davepl Aug 7, 2025
4d095d7
Fix feather_hexagon
davepl Aug 7, 2025
b88a4d9
Merge pull request #739 from PlummersSoftwareLLC/main
davepl Aug 7, 2025
1eb0425
Fix audio on mesmerizer
davepl Aug 8, 2025
c49b60e
Merge branch 'pdpwopr' of github.com:PlummersSoftwareLLC/NightDriverS…
davepl Aug 8, 2025
82728e9
Update soundanalyzer define
davepl Aug 8, 2025
ff4720c
Work around IDF version differences
davepl Aug 8, 2025
36aaa17
Fix missing endif
davepl Aug 8, 2025
76bf1ad
Fix (i2s_mode_t) issue
davepl Aug 8, 2025
7da880e
Remove project default
davepl Aug 8, 2025
9ec664a
Enable Audio in spectrum effects
davepl Aug 8, 2025
dcdd6f3
Enable audio in spectrum2
davepl Aug 8, 2025
32d5625
Revert to custom_effects.h overriding the effect flag
rbergen Aug 9, 2025
fa44d8a
Merge branch 'audio' into pdpwopr
davepl Aug 11, 2025
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
134 changes: 134 additions & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/bash

# Parallel Build Script for NightDriverStrip
# Usage: ./build_all.sh [max_jobs]
# Example: ./build_all.sh 4 # Build with 4 parallel jobs

set -e

# Cleanup function for graceful exit
cleanup() {
echo
echo "Build interrupted. Cleaning up..."
# Kill any remaining background processes
jobs -p | xargs -r kill 2>/dev/null || true
exit 1
}

# Set up signal handlers
trap cleanup SIGINT SIGTERM

# Show help if requested
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo "Usage: $0 [max_jobs]"
echo "Build all PlatformIO environments in parallel"
echo ""
echo "Arguments:"
echo " max_jobs Maximum number of parallel build jobs (default: number of CPU cores)"
echo ""
echo "Examples:"
echo " $0 # Build with all CPU cores"
echo " $0 4 # Build with 4 parallel jobs"
echo " $0 1 # Build sequentially"
exit 0
fi

# Get max parallel jobs (default to number of CPU cores)
MAX_JOBS=${1:-$(nproc)}

# Validate MAX_JOBS is a positive integer
if ! [[ "$MAX_JOBS" =~ ^[1-9][0-9]*$ ]]; then
echo "Error: Invalid number of jobs '$MAX_JOBS'. Must be a positive integer."
echo "Use '$0 --help' for usage information."
exit 1
fi

echo "Building all NightDriverStrip environments with $MAX_JOBS parallel jobs..."

# Get list of all available environments
ENV_LIST=$(grep "^\[env:" platformio.ini | sed 's/^\[env:\(.*\)\]$/\1/')

if [ -z "$ENV_LIST" ]; then
echo "Error: No environments found. Make sure you're in a PlatformIO project directory with platformio.ini."
exit 1
fi

# Convert to array
readarray -t ENVS <<< "$ENV_LIST"

echo "Found ${#ENVS[@]} environments:"
printf '%s\n' "${ENVS[@]}" | sed 's/^/ - /'
echo

# Function to build a single environment
build_env() {
local env=$1
local start_time=$(date +%s)

echo "[$(date '+%H:%M:%S')] Starting build for $env..."

if pio run -e "$env" > "build_${env}.log" 2>&1; then
local end_time=$(date +%s)
local duration=$((end_time - start_time))
echo "[$(date '+%H:%M:%S')] ✅ $env completed in ${duration}s"
echo "$env,SUCCESS,$duration" >> build_results.csv
else
local end_time=$(date +%s)
local duration=$((end_time - start_time))
echo "[$(date '+%H:%M:%S')] ❌ $env failed in ${duration}s"
echo "$env,FAILED,$duration" >> build_results.csv
fi
}

# Export function for parallel execution
export -f build_env

# Initialize results file
echo "Environment,Status,Duration(s)" > build_results.csv

# Start timing
BUILD_START=$(date +%s)

# Run builds in parallel using xargs
printf '%s\n' "${ENVS[@]}" | xargs -n 1 -P "$MAX_JOBS" -I {} bash -c 'build_env "$@"' _ {}

# Calculate total time
BUILD_END=$(date +%s)
TOTAL_DURATION=$((BUILD_END - BUILD_START))

echo
echo "=== Build Summary ==="
echo "Total time: ${TOTAL_DURATION}s"
echo

# Show results summary
if [ -f build_results.csv ]; then
echo "Results summary:"
echo "----------------"

SUCCESS_COUNT=$(grep -c ",SUCCESS," build_results.csv || echo 0)
FAILED_COUNT=$(grep -c ",FAILED," build_results.csv || echo 0)

echo "✅ Successful builds: $SUCCESS_COUNT"
echo "❌ Failed builds: $FAILED_COUNT"

if [ $FAILED_COUNT -gt 0 ]; then
echo
echo "Failed environments:"
grep ",FAILED," build_results.csv | cut -d',' -f1 | sed 's/^/ - /'
echo
echo "Check individual log files (build_<env>.log) for detailed error information."
fi

echo
echo "Detailed results saved to: build_results.csv"
echo "Individual logs saved to: build_<environment>.log"
else
echo "Error: Results file not found."
fi

# Cleanup on successful completion
if [ $FAILED_COUNT -eq 0 ]; then
echo "All builds successful! Cleaning up log files..."
rm -f build_*.log
fi
1 change: 1 addition & 0 deletions build_results.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ttgo,FAILED,24
2 changes: 1 addition & 1 deletion include/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
#define EFFECT_MATRIX_SILON 160
#define EFFECT_MATRIX_PDPGRID 161
#define EFFECT_MATRIX_AUDIOSPIKE 162

#define EFFECT_MATRIX_PDPCMX 163
// Hexagon Effects
#define EFFECT_HEXAGON_OUTER_RING 201

Expand Down
119 changes: 111 additions & 8 deletions include/effects/strip/misceffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,22 +576,125 @@ class PDPGridEffect : public LEDStripEffect

virtual size_t DesiredFramesPerSecond() const
{
return 20;
return 5;
}

bool RequiresDoubleBuffering() const override
{
return false;
}

virtual void Start() override
{
g()->Clear();
}

virtual void Draw() override
{
fadeAllChannelsToBlackBy(255 * g_Values.AppTime.LastFrameTime());
fadeAllChannelsToBlackBy(60);
g()->MoveY(1);
for (int x = 0; x < MATRIX_WIDTH; x++)
{
// Pick a color, CRGB::Red 90% of the time, CRGB::Green 10% of the time
CRGB color = random(0, 100) > 20 ? CRGB::Black : CRGB(random(0, 100) < 90) ? CRGB::Red : CRGB::Orange;
setPixelOnAllChannels(x, MATRIX_HEIGHT-1, color);
}
}
};

// PDPCMXEffect
//
// Connection Machine 5 LED simulation for the PDP-11/34 CMX display

class PDPCMXEffect : public LEDStripEffect
{
private:
static constexpr int GROUP_HEIGHT = 5; // Height of each logical group
static constexpr float LED_PROBABILITY = 0.30f; // 30% chance of LED being on

void scrollGroup(int groupStartY, bool scrollLeft)
{
// Scroll existing LEDs in the group
for (int y = groupStartY; y < groupStartY + GROUP_HEIGHT && y < MATRIX_HEIGHT; y++)
{
if (scrollLeft)
{
// Scroll left: move all pixels one position left
for (int x = 0; x < MATRIX_WIDTH - 1; x++)
{
CRGB color = _GFX[0]->getPixel(x + 1, y);
setPixelOnAllChannels(x, y, color);
}
// Clear the rightmost pixel (will be populated with new random data)
setPixelOnAllChannels(MATRIX_WIDTH - 1, y, CRGB::Black);
}
else
{
// Scroll right: move all pixels one position right
for (int x = MATRIX_WIDTH - 1; x > 0; x--)
{
CRGB color = _GFX[0]->getPixel(x - 1, y);
setPixelOnAllChannels(x, y, color);
}
// Clear the leftmost pixel (will be populated with new random data)
setPixelOnAllChannels(0, y, CRGB::Black);
}
}

// Add new random LEDs on the appropriate edge
for (int y = groupStartY; y < groupStartY + GROUP_HEIGHT && y < MATRIX_HEIGHT; y++)
{
if (random(100) < (LED_PROBABILITY * 100))
{
CRGB color = CRGB::Red;
if (scrollLeft)
setPixelOnAllChannels(MATRIX_WIDTH - 1, y, color);
else
setPixelOnAllChannels(0, y, color);
}
}
}

public:

PDPCMXEffect() : LEDStripEffect(EFFECT_MATRIX_PDPCMX, "PDPCMXEffect")
{
}

PDPCMXEffect(const JsonObjectConst& jsonObject)
: LEDStripEffect(jsonObject)
{
}

virtual size_t DesiredFramesPerSecond() const
{
return 30; // Moderate speed for scrolling effect
}

virtual bool CanDisplayVUMeter() const override
{
return false;
}

virtual void Start() override
{
g()->Clear();
}

virtual void Draw() override
{
// Process each logical group
int numGroups = (MATRIX_HEIGHT + GROUP_HEIGHT - 1) / GROUP_HEIGHT; // Ceiling division

fadeAllChannelsToBlackBy(5);
EVERY_N_MILLISECONDS(200)
{
g()->MoveY(1);
for (int x = 0; x < MATRIX_WIDTH; x++)
for (int group = 0; group < numGroups; group++)
{
if (random(0, 100) < 20)
setPixelOnAllChannels(x, MATRIX_HEIGHT-1, CRGB::Red);
else
setPixelOnAllChannels(x, MATRIX_HEIGHT-1, CRGB::Black);
int groupStartY = group * GROUP_HEIGHT;
bool scrollLeft = (group % 2 == 0); // Alternate direction: even groups scroll left, odd scroll right

scrollGroup(groupStartY, scrollLeft);
}
}
}
Expand Down
Loading