First implementation of INA3221 power monitor
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "adc.h"
|
||||
#include "usb.h"
|
||||
#include "digital_out.h"
|
||||
#include "power_monitor.h"
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -123,6 +124,15 @@ int command_handler(struct command_message_t *msg) {
|
||||
break;
|
||||
}
|
||||
|
||||
case POWER_MONITOR_SET_READ: {
|
||||
int interval_ms;
|
||||
memcpy(&interval_ms, &msg->data[0], sizeof(int));
|
||||
|
||||
power_monitor_timer_set(interval_ms);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
LOG_WRN("Unknown command received: %d", msg->command);
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user