Cleanup 3rd party samples; update README.md; add some missing copyright, fix builds for boards without certain pin definitions
This commit is contained in:
@@ -66,7 +66,7 @@ float mcp9808_convert_temp(uint8_t upper_byte, uint8_t lower_byte) {
|
||||
return temperature;
|
||||
}
|
||||
|
||||
|
||||
#ifdef i2c_default
|
||||
void mcp9808_set_limits() {
|
||||
|
||||
//Set an upper limit of 30°C for the temperature
|
||||
@@ -97,7 +97,7 @@ void mcp9808_set_limits() {
|
||||
buf[2] = crit_temp_lsb;;
|
||||
i2c_write_blocking(i2c_default, ADDRESS, buf, 3, false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
|
||||
@@ -117,7 +117,6 @@ int main() {
|
||||
gpio_pull_up(PICO_DEFAULT_I2C_SCL_PIN);
|
||||
// Make the I2C pins available to picotool
|
||||
bi_decl(bi_2pins_with_func(PICO_DEFAULT_I2C_SDA_PIN, PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C));
|
||||
#endif
|
||||
|
||||
mcp9808_set_limits();
|
||||
|
||||
@@ -144,4 +143,5 @@ int main() {
|
||||
|
||||
sleep_ms(1000);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user