Skip to content

Commit

Permalink
Single-shot mode fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiğit Topcu committed Sep 5, 2022
1 parent 3ef1fcd commit 7dbc717
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 64 deletions.
29 changes: 15 additions & 14 deletions 01_99_Sambilight.init
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# (c) Copyright 1996 - 2021, SamyGO
# (c) Copyright 1996 - 2022, SamyGO
#
#
. /dtv/SGO.env
Expand All @@ -14,21 +14,22 @@ BOTTOM_GAP=7; # Bottom side gap (Top Size - Bottom Size)
START_OFFSET=68; # Index of first led (Top Left is zero) (H_LEDS + V_LEDS + (H_LEDS - BOTTOM_GAP / 2))

# Optional Parameters
CLOCKWISE=1; # Led order (Set to 0 for anti-clockwise)
BLACK_BORDER=1; # Black border detection for automatic profile switching (16:9, 21:9, 4:3, 3:2)
TV_REMOTE=1; # Enable control with TV remote buttons (Red, Green, Yellow, Blue)
EXTERNAL=0; # On/Off support for remotely connected leds (Handled on USB device)
BAUDRATE=921600; # USB Serial baudrate (High baudrate is recommended)
GFX_LIB=1; # Capture directly from graphics driver resulting +50 FPS and prevents UI from lagging during capture (Experimental! Tested on F, not required/available on H)
CAPTURE_FREQ=30; # Capture frequency in ms, increase this value if your TV having performance issues (Higher the value, lower the refresh rate. Smooting must be handled on USB device)
CAPTURE_SIZE=5; # Higher capture size resulting less flickering and more accurate blacks but it affects overall FPS (1=96x54 2=160x90 3=240x135 4=320x180 5=480x270 6=960x540)
OSD_CAPTURE=1; # Capture with OSD (Only works with GFX_LIB=1)
#CLOCKWISE=1; # Led order (Set to 0 for anti-clockwise)
#BLACK_BORDER=1; # Black border detection for automatic profile switching (16:9, 21:9, 4:3, 3:2)
#TV_REMOTE=1; # Enable control with TV remote buttons (Red, Green, Yellow, Blue)
#EXTERNAL=0; # On/Off support for remotely connected leds (Handled on USB device)
#BAUDRATE=921600; # USB Serial baudrate (High baudrate is recommended)
#GFX_LIB=1; # Capture directly from graphics driver resulting +50 FPS and prevents UI from lagging during capture (Experimental! Tested on F, not required/available on H)
#CAPTURE_FREQ=30; # Capture frequency in ms, increase this value if your TV having performance issues (Higher the value, lower the refresh rate. Smooting must be handled on USB device)
#CAPTURE_SIZE=5; # Higher capture size resulting less flickering and more accurate blacks but it affects overall FPS (1=96x54 2=160x90 3=240x135 4=320x180 5=480x270 6=960x540)
#OSD_CAPTURE=1; # Capture with OSD (Only works with GFX_LIB=1)
#FORCE_UPDATE=0; # Force leds to update even colors are not changed (Required for WLED)

# For Testing
TEST_FRAMES=0; # For configuration and performance testing (Set to 1 for single-shot mode)
TEST_PROFILE=0; # Profile index for testing (Only for single-shot mode)
TEST_PATTERN=0; # Display test pattern for selected profile (Only for single-shot mode)
TEST_SAVE_CAPTURE=0; # Save capture as BMP to /dtv/Sambilight.bmp (Only for single-shot mode)
#TEST_FRAMES=30; # For configuration and performance testing (Set to 1 for single-shot mode)
#TEST_PROFILE=0; # Profile index for testing (Only for single-shot mode)
#TEST_PATTERN=0; # Display test pattern for selected profile (Only for single-shot mode)
#TEST_SAVE_CAPTURE=0; # Save capture as BMP to /dtv/Sambilight.bmp (Only for single-shot mode)
##############################################################################################################################################


Expand Down
2 changes: 1 addition & 1 deletion led_manager.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* tasshack
* (c) 2019 - 2021
* (c) 2019 - 2022
*
* License: GPLv3
*
Expand Down
2 changes: 1 addition & 1 deletion led_manager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* tasshack
* (c) 2019 - 2021
* (c) 2019 - 2022
*
* License: GPLv3
*
Expand Down
2 changes: 1 addition & 1 deletion led_profile.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* tasshack
* (c) 2019 - 2021
* (c) 2019 - 2022
*
* License: GPLv3
*
Expand Down
10 changes: 8 additions & 2 deletions sambilight-arduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#if defined(ESP8266)
#define FASTLED_ESP8266_RAW_PIN_ORDER
#elif defined(ESP32)
#define FASTLED_ESP32_RAW_PIN_ORDER
#endif

#include <Arduino.h>
Expand Down Expand Up @@ -47,15 +49,19 @@ void setup() {
FastLED.setBrightness(BRIGHTNESS);
FastLED.show();

#if defined(ESP8266)
#if defined(ESP8266) || defined(ESP32)
Serial.setRxBufferSize(2048);
#endif

#if defined(ESP32)
Serial.begin(BAUDRATE, SERIAL_8N1, 13, 12); // RX pin will be GPIO13 on ESP32
#else
Serial.begin(BAUDRATE);
#endif

#if defined(ESP8266)
delay(500);
Serial.swap(); // RX pin will be GPIO13
Serial.swap(); // RX pin will be GPIO13 on ESP8266
delay(500);
#endif

Expand Down
Loading

0 comments on commit 7dbc717

Please sign in to comment.