some refactoring,

minor code changes
added a small class for SNESController reading
This commit is contained in:
2021-01-03 16:21:20 +01:00
parent ac74587ee7
commit 3babe3f1ef
8 changed files with 188 additions and 22 deletions

View File

@@ -17,7 +17,7 @@
template <int PIN_NUM_MISO, int PIN_NUM_MOSI, int PIN_NUM_CLK> class HardSPI {
//class HardSPI {
static constexpr int MAX_LEN = 4000;
static constexpr int MAX_LEN = 8192;
spi_device_handle_t spi;
@@ -57,7 +57,7 @@ private:
// DEVICE specific options
memset(&devcfg, 0, sizeof(devcfg));
devcfg.clock_speed_hz = 10 * 1000 * 1000;
devcfg.clock_speed_hz = 20 * 1000 * 1000; // IMPORTANT!
devcfg.mode = 0;
devcfg.spics_io_num = -1;//PIN_NUM_CS; // currently not used
devcfg.queue_size = 2;
@@ -104,6 +104,7 @@ public:
}
void read(uint8_t* dst, size_t len) {
// sanity check