Changeset - da187468cae4
[Not reviewed]
default
0 1 0
matthewreed - 8 years ago 2017-04-10 18:15:48

Added default cases to switch statements
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/protocol.c
Show inline comments
 
@@ -73,48 +73,51 @@ bool protocol_process_message(protocol_m
 
            case SILENCE_BUS:
 
                {
 
                    //silence can bus
 
                    result = can_silence_bus(message->data.float_data!=0.0f);
 
                }
 
                break;
 
            case SET_OUTPUT:
 
                {
 
                    //call set output weak function
 
                    result = protocol_set_output(message);
 
                }
 
                break;
 
            case GET_DATA:
 
                {
 
                    //call get data weak function
 
                    result = protocol_get_data(message);
 
                }
 
                break;
 
            case CONFIG:
 
                {
 
                    //call config weak function
 
                    result = protocol_config(message);
 
                }
 
                break;
 
            default:
 
                result = false;
 
                break;
 
        }
 
    }
 
    
 
    return result;
 
}
 
 
bool protocol_send_data(protocol_data_key_t key, uint8_t sensor, float data)
 
{
 
    bool result = true;
 
 
    protocol_message_t message;
 
    message.command = false;
 
    message.id = protocol_device;
 
    message.key = key;
 
    message.sensor = sensor;
 
    message.data.float_data = data;
 
 
    result = protocol_send_message(&message);
 
 
    return result;
 
}
 
 
__weak bool protocol_estop(bool value)
 
{
0 comments (0 inline, 0 general)