• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!

Search the Community

Showing results for tags 'enum'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

  • Community Calendar

Found 1 result

  1. Hi. Got stuck. I have a project with a line in variables.h: enum IOchannel {V1 = 11, I1 = 101, V2 = 12, I2 = 102}; Then I have an input.c, where I initialize all variables declared in variables.h(as extern), however, I don't use it for my enum, because I would get an error that my variables are already defined (due to include). Finally, I have another file which sends on LCD my enum variables, i.e. if it was V1 received, then you'll see "V1 = xxx" on the LCD. lcd_send_string(enum2str(haltIn)); where the function is void lcd_send_string(char *s); and so there's a function char *enum2str(enum IOchannel enumVariable) { // convert ENUM to CHAR switch (enumVariable) {case V1: return "V1"; case V2: return "V2"; case I1: return "I1"; case I2: return "I2";} } When I am trying to compile my code (GCC 4.2.4) I receive a message "argument of type "enum IOchannel" is incompatible with parameter of type "enum IOchannel"" every time I am trying to use my function. What is the correct way to declare, initialize and use my enum variable? Thanks.