Cleanup 3rd party samples; update README.md; add some missing copyright, fix builds for boards without certain pin definitions

This commit is contained in:
Graham Sanderson
2021-10-28 14:56:05 -05:00
committed by GitHub
parent 1300621684
commit fa09f2c88e
16 changed files with 111 additions and 117 deletions

View File

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