/*!
* \brief Lookup label for 'CorvidPackets' enum entry
*
* \param value is the integer value of the enum entry
* \return string label of the given entry (emptry string if not found)
*/
char* CorvidPackets_Label(int value)
{
switch (value)
{
default:
return "";
case STARTER_PKT_STATUS_A:
return "STARTER_PKT_STATUS_A";
case STARTER_PKT_STATUS_B:
return "STARTER_PKT_STATUS_B";
case STARTER_PKT_WRITE_REG:
return "STARTER_PKT_WRITE_REG";
case STARTER_PKT_READ_REG:
return "STARTER_PKT_READ_REG";
case STARTER_PKT_REG_DATA:
return "STARTER_PKT_REG_DATA";
case STARTER_PKT_MOTOR_SETTINGS:
return "STARTER_PKT_MOTOR_SETTINGS";
case STARTER_PKT_ADDRESS:
return "STARTER_PKT_ADDRESS";
case STARTER_PKT_FIRMWARE:
return "STARTER_PKT_FIRMWARE";
case STARTER_PKT_SYSTEM_INFO:
return "STARTER_PKT_SYSTEM_INFO";
case STARTER_PKT_TELEMETRY_CFG:
return "STARTER_PKT_TELEMETRY_CFG";
case STARTER_PKT_EEPROM_INFO:
return "STARTER_PKT_EEPROM_INFO";
}
}
This PR adds the ability to (optionally) generate code to lookup the label for an enumerated value based on the integer value.
The lookup tag should be added to an enum to enable this functionality.
Example:
produces: