1
0
mirror of https://github.com/whowechina/iidx_pico.git synced 2024-09-23 18:58:22 +02:00

Turntable hotswap

This commit is contained in:
whowechina 2023-04-05 11:49:50 +08:00
parent fd91994908
commit 71082ef029
4 changed files with 26 additions and 6 deletions

20
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -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
}

Binary file not shown.

View File

@ -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.

View File

@ -54,11 +54,11 @@ static uint16_t angle = 0;
void turntable_update()
{
uint8_t reg = 0x0c;
i2c_write_blocking(TT_AS5600_I2C, as5600_addr, &reg, 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];
}