Skip to content

Commit

Permalink
Merge branch 'release/v17.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Feb 27, 2024
2 parents 3968ee7 + 1352e5f commit 0513b15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions examples/zephyr-drivers-can/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void rx_thread(void *arg1, void *arg2, void *arg3)
ARG_UNUSED(arg2);
ARG_UNUSED(arg3);
const struct can_filter filter = {
.flags = CAN_FILTER_DATA | CAN_FILTER_IDE,
.flags = CAN_FILTER_IDE,
.id = COUNTER_MSG_ID,
.mask = CAN_EXT_ID_MASK
};
Expand All @@ -76,6 +76,10 @@ void rx_thread(void *arg1, void *arg2, void *arg3)
while (1) {
k_msgq_get(&counter_msgq, &frame, K_FOREVER);

if (IS_ENABLED(CONFIG_CAN_ACCEPT_RTR) && (frame.flags & CAN_FRAME_RTR) != 0U) {
continue;
}

if (frame.dlc != 2U) {
printf("Wrong data length: %u\n", frame.dlc);
continue;
Expand All @@ -92,6 +96,10 @@ void change_led_work_handler(struct k_work *work)
int ret;

while (k_msgq_get(&change_led_msgq, &frame, K_NO_WAIT) == 0) {
if (IS_ENABLED(CONFIG_CAN_ACCEPT_RTR) && (frame.flags & CAN_FRAME_RTR) != 0U) {
continue;
}

if (led.port == NULL) {
printf("LED %s\n", frame.data[0] == SET_LED ? "ON" : "OFF");
} else {
Expand Down Expand Up @@ -192,7 +200,7 @@ void state_change_callback(const struct device *dev, enum can_state state,
int main(void)
{
const struct can_filter change_led_filter = {
.flags = CAN_FILTER_DATA,
.flags = 0U,
.id = LED_MSG_ID,
.mask = CAN_STD_ID_MASK
};
Expand Down Expand Up @@ -230,7 +238,7 @@ int main(void)
}

if (led.port != NULL) {
if (!device_is_ready(led.port)) {
if (!gpio_is_ready_dt(&led)) {
printf("LED: Device %s not ready.\n",
led.port->name);
return 0;
Expand Down
6 changes: 3 additions & 3 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-ststm32.git"
},
"version": "17.2.0",
"version": "17.3.0",
"frameworks": {
"mbed": {
"package": "framework-mbed",
Expand Down Expand Up @@ -214,7 +214,7 @@
"type": "framework",
"optional": true,
"owner": "platformio",
"version": "~4.0.6"
"version": "~4.1.1"
},
"framework-stm32cubef0": {
"type": "framework",
Expand Down Expand Up @@ -298,7 +298,7 @@
"type": "framework",
"optional": true,
"owner": "platformio",
"version": "~2.30500.0"
"version": "~2.30600.0"
},
"tool-stm32duino": {
"type": "uploader",
Expand Down

0 comments on commit 0513b15

Please sign in to comment.