got no-gui version of Pd running with built-in test patch
This commit is contained in:
parent
83bfb754c6
commit
94ce3f1bae
5 changed files with 1156 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
set(COMPONENT_SRCS "weasel.c fifostream.c \
|
||||
set(COMPONENT_SRCS "weasel.c fifostream.c pdmain.c \
|
||||
../pd/src/g_canvas.c \
|
||||
../pd/src/g_graph.c \
|
||||
../pd/src/g_text.c \
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
static const char *TAG = "fifostream";
|
||||
|
||||
#define BUF_SIZE (100)
|
||||
extern void pdmain_tick( void);
|
||||
|
||||
typedef struct fifostream {
|
||||
int samplerate;
|
||||
|
|
@ -64,6 +65,7 @@ int phaseinc = 123;
|
|||
|
||||
static int fifostream_process(audio_element_handle_t self, char *in_buffer, int in_len)
|
||||
{
|
||||
static int cumsamps = 0;
|
||||
fifostream_t *fifostream = (fifostream_t *)audio_element_getdata(self);
|
||||
int ret = 0;
|
||||
int r_size = 0;
|
||||
|
|
@ -83,6 +85,12 @@ static int fifostream_process(audio_element_handle_t self, char *in_buffer, int
|
|||
phase += phaseinc ;
|
||||
fifostream->s_buf[i] = (phase >> 3);
|
||||
}
|
||||
cumsamps += r_size/sizeof(short);
|
||||
while (cumsamps >= 128)
|
||||
{
|
||||
pdmain_tick();
|
||||
cumsamps -= 128;
|
||||
}
|
||||
}
|
||||
ret = audio_element_output(self, (char *)fifostream->s_buf, BUF_SIZE);
|
||||
} else {
|
||||
|
|
|
|||
1136
main/pdmain.c
Normal file
1136
main/pdmain.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -29,6 +29,9 @@
|
|||
#include "time.h"
|
||||
#include "sys/time.h"
|
||||
|
||||
extern void pdmain_init( void);
|
||||
|
||||
|
||||
#define SPP_TAG "WOMBAT"
|
||||
#define SPP_SERVER_NAME "SPP_SERVER"
|
||||
#define EXCAMPLE_DEVICE_NAME "ESP_SPP_ACCEPTOR"
|
||||
|
|
@ -36,6 +39,11 @@
|
|||
#define SPP_SHOW_SPEED 1
|
||||
#define SPP_SHOW_MODE SPP_SHOW_DATA /*Choose show mode: show data or speed*/
|
||||
|
||||
void pdmain_print( const char *s)
|
||||
{
|
||||
ESP_LOGI("PD", "%s" , s);
|
||||
}
|
||||
|
||||
static const esp_spp_mode_t esp_spp_mode = ESP_SPP_MODE_CB;
|
||||
|
||||
static struct timeval time_new, time_old;
|
||||
|
|
@ -326,6 +334,8 @@ void app_main()
|
|||
esp_bt_pin_code_t pin_code;
|
||||
esp_bt_gap_set_pin(pin_type, 0, pin_code);
|
||||
|
||||
pdmain_init();
|
||||
|
||||
audio_main();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
|
|||
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
|
||||
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
|
||||
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=3584
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=40000
|
||||
CONFIG_IPC_TASK_STACK_SIZE=1024
|
||||
CONFIG_TIMER_TASK_STACK_SIZE=3584
|
||||
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
|
||||
|
|
|
|||
Loading…
Reference in a new issue