mirror of
https://github.com/whowechina/iidx_pico.git
synced 2025-02-11 16:43:05 +01:00
I2C to 333KHz for higher reliability.
This commit is contained in:
parent
4a83280c97
commit
fd1f475fbe
@ -27,7 +27,7 @@ void turntable_init()
|
||||
adc_gpio_init(TT_AS5600_ANALOG);
|
||||
adc_select_input(TT_AS5600_ANALOG - 26);
|
||||
#else
|
||||
i2c_init(TT_AS5600_I2C, 800 * 1000);
|
||||
i2c_init(TT_AS5600_I2C, 333 * 1000);
|
||||
gpio_set_function(TT_AS5600_SCL, GPIO_FUNC_I2C);
|
||||
gpio_set_function(TT_AS5600_SDA, GPIO_FUNC_I2C);
|
||||
gpio_pull_up(TT_AS5600_SCL);
|
||||
@ -35,6 +35,8 @@ void turntable_init()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TT_AS5600_ANALOG
|
||||
|
||||
uint32_t max_adc = 3500;
|
||||
static inline void adjust_max(uint32_t value)
|
||||
{
|
||||
@ -76,6 +78,7 @@ static uint16_t read_average(uint16_t size)
|
||||
|
||||
return (all / size) % max_adc;
|
||||
}
|
||||
#endif
|
||||
|
||||
void turntable_update()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user