Changeset - 10c03b9c67e6
[Not reviewed]
default
0 1 0
matthewreed - 7 years ago 2017-07-20 14:23:43

Added protocol save settings function
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/protocol.c
Show inline comments
 
@@ -8,24 +8,29 @@ void protocol_init(protocol_device_t dev
 
    protocol_device = device;
 
    flash_restore(&protocol_settings);
 
    led_set_brightness(protocol_settings.val.led_brightness);
 
 
    can_init(protocol_settings.val.can_id, DEFAULT_BROADCAST_ID);
 
}
 
 
flash_settings_t* protocol_get_settings(void)
 
{
 
    return &protocol_settings;
 
}
 
 
void protocol_save_settings(void)
 
{
 
    flash_save(&protocol_settings);
 
}
 
 
bool protocol_send_test()
 
{
 
    bool result = true;
 
    can_send_test(protocol_settings.val.can_id | 0x00000001);
 
    return result;
 
}
 
 
bool protocol_receive_message(CanRxMsgTypeDef* can_message)
 
{
 
    bool result = true;
 
    
 
    protocol_message_t message;
0 comments (0 inline, 0 general)