Skip to content

Commit

Permalink
Cleaning dev stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
EremusOne committed Mar 29, 2023
1 parent b18eaa4 commit 626bd66
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
3 changes: 0 additions & 3 deletions include/ESPectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ class ESPectrum

// static int ESPoffset; // Testing

// static ayemu_ay_t ay;
static int bufcount;

private:

static void IRAM_ATTR audioTask(void* unused);
Expand Down
32 changes: 1 addition & 31 deletions src/ESPectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ int ESPectrum::overSamplesPerFrame = ESP_AUDIO_OVERSAMPLES_48;
bool ESPectrum::AY_emu = false;
int ESPectrum::Audio_freq = ESP_AUDIO_FREQ_48;
// bool ESPectrum::Audio_restart = false;
int ESPectrum::bufcount = 0;

QueueHandle_t audioTaskQueue;
TaskHandle_t audioTaskHandle;
Expand Down Expand Up @@ -263,36 +262,13 @@ void ESPectrum::setup()
audioTaskQueue = xQueueCreate(1, sizeof(uint8_t *));
// Latest parameter = Core. In ESPIF, main task runs on core 0 by default. In Arduino, loop() runs on core 1.
xTaskCreatePinnedToCore(&ESPectrum::audioTask, "audioTask", 1024, NULL, 5, &audioTaskHandle, 1);
// xTaskCreatePinnedToCore(&ESPectrum::audioTask, "audioTask", 2048, NULL, 5, &audioTaskHandle, 1);

// // PWM Audio Init
// pwm_audio_config_t pac;
// pac.duty_resolution = LEDC_TIMER_8_BIT;
// pac.gpio_num_left = SPEAKER_PIN;
// pac.ledc_channel_left = LEDC_CHANNEL_0;
// pac.gpio_num_right = -1;
// pac.ledc_channel_right = LEDC_CHANNEL_1;
// pac.ledc_timer_sel = LEDC_TIMER_0;
// pac.tg_num = TIMER_GROUP_0;
// pac.timer_num = TIMER_0;
// pac.ringbuf_len = 1024 * 8;

// pwm_audio_init(&pac);
// pwm_audio_set_param(Audio_freq,LEDC_TIMER_8_BIT,1);
// pwm_audio_start();
// // pwm_audio_set_volume(aud_volume);

// AY Sound
AySound::init();
AySound::set_sound_format(Audio_freq,1,8);
AySound::set_stereo(AYEMU_MONO,NULL);

// ayemu_init(&ESPectrum::ay);
// ayemu_set_sound_format (&ESPectrum::ay, Audio_freq, 1, 8);
// ayemu_set_stereo(&ay, AYEMU_MONO, NULL);

AySound::reset();
bufcount = 0;

//=======================================================================================
// KEYBOARD
Expand Down Expand Up @@ -431,11 +407,7 @@ void ESPectrum::reset()
AySound::init();
AySound::set_sound_format(Audio_freq,1,8);
AySound::set_stereo(AYEMU_MONO,NULL);
// ayemu_init(&ESPectrum::ay);
// ayemu_set_sound_format (&ESPectrum::ay, Audio_freq, 1, 8);
// ayemu_set_stereo(&ay, AYEMU_MONO, NULL);
AySound::reset();
bufcount = 0;

pwm_audio_start();

Expand Down Expand Up @@ -861,9 +833,7 @@ void IRAM_ATTR ESPectrum::audioTask(void *unused) {
// break;
// }

if ((Z80Ops::is48) || (bufcount==0)) {
pwm_audio_write(audioBuffer, samplesPerFrame, &written, portMAX_DELAY);
}
pwm_audio_write(audioBuffer, samplesPerFrame, &written, portMAX_DELAY);

xQueueReceive(audioTaskQueue, &param, portMAX_DELAY);

Expand Down
4 changes: 0 additions & 4 deletions src/FileSNA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,7 @@ bool FileSNA::load(string sna_fn)
AySound::init();
AySound::set_sound_format(ESPectrum::Audio_freq,1,8);
AySound::set_stereo(AYEMU_MONO,NULL);
// ayemu_init(&ESPectrum::ay);
// ayemu_set_sound_format (&ESPectrum::ay, ESPectrum::Audio_freq, 1, 8);
// ayemu_set_stereo(&ESPectrum::ay, AYEMU_MONO, NULL);
AySound::reset();
ESPectrum::bufcount=0;

pwm_audio_start();

Expand Down
4 changes: 0 additions & 4 deletions src/FileZ80.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,7 @@ bool FileZ80::load(string z80_fn)
AySound::init();
AySound::set_sound_format(ESPectrum::Audio_freq,1,8);
AySound::set_stereo(AYEMU_MONO,NULL);
// ayemu_init(&ESPectrum::ay);
// ayemu_set_sound_format (&ESPectrum::ay, ESPectrum::Audio_freq, 1, 8);
// ayemu_set_stereo(&ESPectrum::ay, AYEMU_MONO, NULL);
AySound::reset();
ESPectrum::bufcount=0;

pwm_audio_start();

Expand Down

0 comments on commit 626bd66

Please sign in to comment.