diff --git a/RpiLedBars/res/src/c.template b/RpiLedBars/res/src/c.template new file mode 100644 index 0000000..1d7dc07 --- /dev/null +++ b/RpiLedBars/res/src/c.template @@ -0,0 +1,45 @@ +/** \file .c + * \brief This module + */ + +/*************************************************************************************************** + * Includes + **************************************************************************************************/ + +/*************************************************************************************************** + * Preprocessor Constants and Macros + **************************************************************************************************/ + +/*************************************************************************************************** + * Type and Contant Definitions + **************************************************************************************************/ + +/*************************************************************************************************** + * Persistent Variables + **************************************************************************************************/ + +/** + * Boolean for interrupting the main thread loop + */ +bool isUdpListenerRunning = false; + +/*************************************************************************************************** + * Internal Function Prototypes + **************************************************************************************************/ + +/** + * \brief This function is used to thread main execution function + * + * \param arg not used. + * + * \return NULL. + */ +static void *artnet_udp_handler(void *arg); + +/*************************************************************************************************** + * External Function Definitions + **************************************************************************************************/ + +/*************************************************************************************************** + * Internal Function Definitions + **************************************************************************************************/ diff --git a/RpiLedBars/res/src/h.template b/RpiLedBars/res/src/h.template new file mode 100644 index 0000000..737647b --- /dev/null +++ b/RpiLedBars/res/src/h.template @@ -0,0 +1,37 @@ +/** \file .h + * \brief This module + */ + +#if !defined(__RPI_ARTNET_H__) +#define __RPI_ARTNET_H__ + +/*************************************************************************************************** + * Includes + **************************************************************************************************/ + +/*************************************************************************************************** + * Preprocessor Constants and Macros + **************************************************************************************************/ + +/*************************************************************************************************** + * Type and Contant Definitions + **************************************************************************************************/ + +/*************************************************************************************************** + * Global Variables + **************************************************************************************************/ + +/*************************************************************************************************** + * External Function Prototypes + **************************************************************************************************/ + +/** + * \brief Get last DMX data received for the specified universe + * + * \param[in] univerve The universe to get data from + * + * \param[out] dmxData The pointer to the DMX data array + */ +int artnet_get_dmx_data(unsigned int univerve, uint8_t *dmxData[]); + +#endif /* __RPI_ARTNET_H__ */ diff --git a/RpiLedBars/res/src/tmp/rpi_cava.c b/RpiLedBars/res/src/tmp/rpi_cava.c index c8bbc0b..466c4a9 100644 --- a/RpiLedBars/res/src/tmp/rpi_cava.c +++ b/RpiLedBars/res/src/tmp/rpi_cava.c @@ -8,11 +8,7 @@ #include #include #include -#ifdef _WIN32 -#include -#else #include -#endif pid_t cavaPid; pthread_t fifoReader; @@ -23,9 +19,9 @@ static void *fifo_to_buffer(void *arg); void setup_cava() {} -void close_cava() { stop_cava_bg_worker(); } +void close_cava() { cava_stop(); } -void start_cava_bg_worker() { +void cava_start() { if ((cavaPid = fork()) == -1) { perror("fork"); exit(1); @@ -52,7 +48,7 @@ void start_cava_bg_worker() { } } -void stop_cava_bg_worker() { +void cava_stop() { if (pthread_cancel(fifoReader) != 0) { perror("pthread_cancel"); } diff --git a/RpiLedBars/res/src/tmp/rpi_cava.h b/RpiLedBars/res/src/tmp/rpi_cava.h index 5c59e1a..90815bd 100644 --- a/RpiLedBars/res/src/tmp/rpi_cava.h +++ b/RpiLedBars/res/src/tmp/rpi_cava.h @@ -9,8 +9,8 @@ int get_cava_buffer(uint16_t buffer_dst[20]); void close_cava(); -void start_cava_bg_worker(); +void cava_start(); -void stop_cava_bg_worker(); +void cava_stop(); #endif /* __RPI_CAVA_H__ */ \ No newline at end of file