some refactoring,
minor code changes added a small class for SNESController reading
This commit is contained in:
11
io/I2S.h
11
io/I2S.h
@@ -28,13 +28,16 @@ public:
|
||||
cfg.mode = static_cast<i2s_mode_t>(I2S_MODE_MASTER | I2S_MODE_TX);
|
||||
#endif
|
||||
|
||||
cfg.dma_buf_count = 6;
|
||||
// cfg.dma_buf_count = 6;
|
||||
// cfg.dma_buf_len = 128;
|
||||
|
||||
cfg.dma_buf_count = 16;
|
||||
cfg.dma_buf_len = 128;
|
||||
|
||||
cfg.sample_rate = 44100;
|
||||
cfg.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT;
|
||||
cfg.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT; //2-channels
|
||||
cfg.communication_format = I2S_COMM_FORMAT_I2S_MSB;
|
||||
cfg.communication_format = I2S_COMM_FORMAT_STAND_I2S;//I2S_COMM_FORMAT_I2S_MSB;
|
||||
|
||||
|
||||
cfg.intr_alloc_flags = 0; //Default interrupt priority
|
||||
@@ -72,9 +75,9 @@ public:
|
||||
}
|
||||
|
||||
/** add the given samples for playback. returns the number of added samples, which might be less in case of timeouts */
|
||||
size_t add(const uint8_t* data, const size_t len) {
|
||||
size_t add(const uint8_t* data, const size_t len_bytes) {
|
||||
size_t written;
|
||||
i2s_write(port, data, len, &written, portMAX_DELAY);
|
||||
i2s_write(port, data, len_bytes, &written, portMAX_DELAY);
|
||||
return written;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user