I appreciate the response.
Well, I have determined one way to change the defaults,but I think I'm better off just using i2c0 or i2c1 to pick the instance.
As far as i2c_default, I'm not sure why the SDK bothers with this, instead of just having the programmer choose the instance and pins. Also, in the examples going through checks the end user should already know to take care of.
In other words, this seems overkill, but just my humble opinion
Well, I have determined one way to change the defaults,
Code:
target_compile_definitions(foo_bar PRIVATE PICO_DEFAULT_I2C=1)
As far as i2c_default, I'm not sure why the SDK bothers with this, instead of just having the programmer choose the instance and pins. Also, in the examples going through checks the end user should already know to take care of.
In other words, this seems overkill, but just my humble opinion
Code:
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN) #warning i2c / bmp280_i2c example requires a board with I2C pins puts("Default I2C pins were not defined"); return 0;#else
Statistics: Posted by breaker — Wed Jan 03, 2024 2:40 am