Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix temp sensor issue #76

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pico/app.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
&i2c0 {
status = "okay";
clock-frequency = <100000>;

lm75@4e{
compatible = "lm75";
reg = <0x4E>;
};
};
2 changes: 1 addition & 1 deletion pico/mcuboot.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="1.0.0+0"
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="1.0.1+0"
1 change: 1 addition & 0 deletions pico/src/pico_csp.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static void server(void)
int result = get_temp(&temp);
if (result < 0) {
LOG_ERR("Failed to get temperature");
csp_buffer_free(packet);
} else {
LOG_DBG("Temperature: %.2f℃", (double)temp);
memcpy(packet->data, &temp, sizeof(temp));
Expand Down
5 changes: 0 additions & 5 deletions pico/src/temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(temp, LOG_LEVEL_DBG);

#define DEV_ADDR (0x4e)
#define START_ADDR (0x00)
#define RESOLUTION (0.0625f)
#define BIT_SHIFT (4)

int get_temp(float *temp) {

const struct device *const temp_sensor = DEVICE_DT_GET_ANY(lm75);
Expand Down
10 changes: 0 additions & 10 deletions pico/uart1.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,3 @@
};
};
};

&i2c0 {
status = "okay";
clock-frequency = <100000>;

lm75@4c{
compatible = "lm75";
reg = <0x4C>;
};
};