auto formatting cleanups

This commit is contained in:
Kevin Matz 2020-12-04 14:57:57 -05:00
parent f599b899e5
commit b5e58743e4
3 changed files with 75 additions and 76 deletions

View File

@ -1,27 +1,27 @@
/* /*
strobe_esp32.h strobe_esp32.h
Part of WiFlash_esp32 Part of WiFlash_esp32
Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com) Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#ifndef STROBE_ESP32_H_ #ifndef STROBE_ESP32_H_

View File

@ -2,28 +2,28 @@
WiFlash_esp32 - Concept & electronics: Phil Abeyta WiFlash_esp32 - Concept & electronics: Phil Abeyta
- System design & firmware: Kevin Matz - System design & firmware: Kevin Matz
Uses a GPIO to control a lighting console over OSC, whilst also Uses a GPIO to control a lighting console over OSC, whilst also
controlling an LED strobe light with DMX data recieved over sACN. controlling an LED strobe light with DMX data recieved over sACN.
Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com) Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <WiFi.h> #include <WiFi.h>
@ -33,8 +33,8 @@ SOFTWARE.
/* /*
* This section to be configured by Lighting Control This section to be configured by Lighting Control
*/ */
// ----------------------------------- // -----------------------------------
// Configure the WiFi network // Configure the WiFi network
// ----------------------------------- // -----------------------------------
@ -66,28 +66,28 @@ const uint16_t strobe_universe = 1;
const uint16_t strobe_address = 501; const uint16_t strobe_address = 501;
/* DMX Value /* DMX Value
* | chan | Command | range | range | | chan | Command | range | range |
* |------+-----------+-------+------------| |------+-----------+-------+------------|
* | 1 | Intensity | 0- | 0-100% | 15 bit 2.4kHz PWM | 1 | Intensity | 0- | 0-100% | 15 bit 2.4kHz PWM
* | 2 | fine | 65535 | | | 2 | fine | 65535 | |
* |------+-----------+-------+------------| |------+-----------+-------+------------|
* | 3 | Duration | 0-255 | 0.02-0.5s | 0.002s resolution | 3 | Duration | 0-255 | 0.02-0.5s | 0.002s resolution
* |------+-----------+-------+------------| |------+-----------+-------+------------|
* | 4 | Rate | 0-255 | 0.5-25hz | 0.1 hz resolution | 4 | Rate | 0-255 | 0.5-25hz | 0.1 hz resolution
* |------+-----------+-------+------------| |------+-----------+-------+------------|
*/ */
/* /*
* This section to be configured by the Fixtures Dept. This section to be configured by the Fixtures Dept.
*/ */
const int button = A0; // A0, use 100nF to ground const int button = A0; // A0, use 100nF to ground
const int led = LED_BUILTIN; // IO13 const int led = LED_BUILTIN; // IO13
/* /*
* Change nothing else unless you're really sure. Change nothing else unless you're really sure.
*/ */
//// device objects //// device objects
Strobe *strobe = new Strobe(strobe_universe, strobe_address); Strobe *strobe = new Strobe(strobe_universe, strobe_address);
@ -98,12 +98,12 @@ bool pressed = false; // track button state
uint32_t change_time; // time of button press (ms) uint32_t change_time; // time of button press (ms)
/* /*
* Arduino powerup Arduino powerup
*/ */
void setup() { void setup() {
Serial.begin(115200); Serial.begin(115200);
//// start WiFi: //// start WiFi:
// set IPv4 // set IPv4
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.config(ip, gateway, subnet); WiFi.config(ip, gateway, subnet);
@ -130,10 +130,9 @@ void setup() {
} }
//// start fixtures hardware: //// start fixtures hardware:
// button // button
pinMode(button, INPUT_PULLUP); pinMode(button, INPUT_PULLUP);
// led_trigPres_trigPress _trigPress _trigPress _trigPress s
if (!strobe->begin(led, 0)) { if (!strobe->begin(led, 0)) {
Serial.println("Strobe failed to configure."); Serial.println("Strobe failed to configure.");
} }
@ -141,8 +140,8 @@ void setup() {
/* /*
* Arduino process loop Arduino process loop
*/ */
void loop() { void loop() {
if (WiFi.status() != WL_CONNECTED) { if (WiFi.status() != WL_CONNECTED) {
Serial.println("Waiting for WiFi..."); Serial.println("Waiting for WiFi...");