mirror of https://github.com/arendst/Tasmota.git
commit
08f8adf1fa
|
@ -197,8 +197,8 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2])
|
||||||
// Deprecated. Use i2s_write
|
// Deprecated. Use i2s_write
|
||||||
// return i2s_write_bytes((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), 0);
|
// return i2s_write_bytes((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), 0);
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
return (ESP_OK == i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0));
|
i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0);
|
||||||
// return bytes_written;
|
return bytes_written;
|
||||||
#else
|
#else
|
||||||
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL]))<<16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL]))<<16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
||||||
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
|
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
|
||||||
|
@ -225,5 +225,3 @@ bool AudioOutputI2S::stop()
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,8 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
|
||||||
// Deprecated. Use i2s_write
|
// Deprecated. Use i2s_write
|
||||||
// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
|
// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
if (ESP_OK != i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0))
|
i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0);
|
||||||
|
if (!bytes_written)
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
|
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
|
||||||
|
|
Loading…
Reference in New Issue