diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..2cef924 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,20 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "D:/Code/pico-sdk/**", + "D:/Code/lib/**", + "${workspaceFolder}/firmware/build/generated/pico_base" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE", + "BOARD_IIDX_PICO" + ], + "intelliSenseMode": "linux-gcc-arm64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Production/Firmware/iidx_pico.uf2 b/Production/Firmware/iidx_pico.uf2 index 5399a32..ecdbbd5 100644 Binary files a/Production/Firmware/iidx_pico.uf2 and b/Production/Firmware/iidx_pico.uf2 differ diff --git a/README.md b/README.md index dd59774..64cb690 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Features: * It's thin, really thin. -* Turntable and keyboard are detachable with magnetic connector. +* Turntable and keyboard are detachable with magnetic connector, hotswap! * HID lights, of course! * Multiple turntable effects. * Many live settings. diff --git a/firmware/src/turntable.c b/firmware/src/turntable.c index 308d245..e6fd19c 100644 --- a/firmware/src/turntable.c +++ b/firmware/src/turntable.c @@ -54,11 +54,11 @@ static uint16_t angle = 0; void turntable_update() { - uint8_t reg = 0x0c; - i2c_write_blocking(TT_AS5600_I2C, as5600_addr, ®, 1, true); - - uint8_t buf[2] = {0x0c}; - i2c_read_blocking(TT_AS5600_I2C, as5600_addr, buf, 2, false); + uint8_t buf[2] = {0x0c, 0x00}; + i2c_write_blocking_until(TT_AS5600_I2C, as5600_addr, buf, 1, true, + time_us_64() + 1000); + i2c_read_blocking_until(TT_AS5600_I2C, as5600_addr, buf, 2, false, + time_us_64() + 1000); angle = ((uint16_t)buf[0]) << 8 | buf[1]; }