diff --git a/inc/led.h b/inc/led.h --- a/inc/led.h +++ b/inc/led.h @@ -19,7 +19,7 @@ void led_update_all(void); void led_set(led_name_t led, bool value); void led_toggle(led_name_t led); -__weak bool gpio_set_led(led_name_t led, bool value); -__weak bool gpio_toggle_led(led_name_t led); +bool gpio_set_led(led_name_t led, bool value); +bool gpio_toggle_led(led_name_t led); #endif /* _LED_H_ */ diff --git a/inc/protocol.h b/inc/protocol.h --- a/inc/protocol.h +++ b/inc/protocol.h @@ -66,9 +66,9 @@ bool protocol_process_message(protocol_m bool protocol_send_data(protocol_data_key_t key, uint8_t sensor, float data); bool protocol_send_test(); -__weak bool protocol_estop(bool value); -__weak bool protocol_set_output(protocol_message_t* message); -__weak bool protocol_get_data(protocol_message_t* message); -__weak bool protocol_config(protocol_message_t* message); +bool protocol_estop(bool value); +bool protocol_set_output(protocol_message_t* message); +bool protocol_get_data(protocol_message_t* message); +bool protocol_config(protocol_message_t* message); #endif //_PROTOCOL_H_ diff --git a/src/led.c b/src/led.c --- a/src/led.c +++ b/src/led.c @@ -46,7 +46,8 @@ void led_update(led_name_t led) led_set(led, 0); led_timers[led]--; } - else { + else if (led_cycles[led] > 0) + { led_set(led, 0); led_timers[led] = led_cycles[led]; } diff --git a/src/protocol.c b/src/protocol.c --- a/src/protocol.c +++ b/src/protocol.c @@ -42,14 +42,14 @@ bool protocol_send_message(protocol_mess bool result = true; uint8_t data[8]; - data[0] = (message->command & 0x80) & (message->id & 0x7F); + data[0] = (message->command & 0x80) | (message->id & 0x7F); data[1] = (message->key >> 8) & 0xFF; data[2] = (message->key >> 0) & 0xFF; data[3] = message->sensor; - data[4] = (message->data.byte_data[0] >> 24) & 0xFF; - data[5] = (message->data.byte_data[1] >> 16) & 0xFF; - data[6] = (message->data.byte_data[2] >> 8) & 0xFF; - data[7] = (message->data.byte_data[3] >> 0) & 0xFF; + data[4] = message->data.byte_data[0]; + data[5] = message->data.byte_data[1]; + data[6] = message->data.byte_data[2]; + data[7] = message->data.byte_data[3]; can_send(protocol_settings.val.can_id | 0x00000001, CAN_ID_STD, 8, data);