title: manage enum var in c (porting code from c++)
body: <p>I´m trying to make a porting of a c++ code to an msp430 c code.
  Since I never faced enumerated type, I´m getting few problem to undestand how to manage it.
  This code was written from Taylor Andrews :
  enum list are defined as:</p>
  <pre><code>    enum accel_odr
  {
      A_POWER_DOWN,   // Power-down mode (0x0)
      A_ODR_3125,     // 3.125 Hz (0x1)
      A_ODR_625,      // 6.25 Hz (0x2)
      A_ODR_125,      // 12.5 Hz (0x3)
      A_ODR_25,       // 25 Hz (0x4)
      A_ODR_50,       // 50 Hz (0x5)
      A_ODR_100,      // 100 Hz (0x6)
      A_ODR_200,      // 200 Hz (0x7)
      A_ODR_400,      // 400 Hz (0x8)
      A_ODR_800,      // 800 Hz (9)
      A_ODR_1600      // 1600 Hz (0xA)
  };
  </code></pre>
  <p>while mine is:</p>
  <pre><code> typedef enum
  {
      A_POWER_DOWN,   // Power-down mode (0x0)
      A_ODR_3125,     // 3.125 Hz (0x1)
      A_ODR_625,      // 6.25 Hz (0x2)
      A_ODR_125,      // 12.5 Hz (0x3)
      A_ODR_25,       // 25 Hz (0x4)
      A_ODR_50,       // 50 Hz (0x5)
      A_ODR_100,      // 100 Hz (0x6)
      A_ODR_200,      // 200 Hz (0x7)
      A_ODR_400,      // 400 Hz (0x8)
      A_ODR_800,      // 800 Hz (9)
      A_ODR_1600      // 1600 Hz (0xA)
  }accel_odr;
  </code></pre>
  <p>than in the header file he define a var related to the enum as:</p>
  <p><code>    uint16_t begin( accel_odr aODR = A_ODR_50);</code>
  doing this operation, while compiling I get the error:</p>
  <p>Description Resource    Path    Location    Type</p>
  <h1>18 expected a &quot;)&quot;  LSM9DS0.c   /ACC    line 130    C/C++ Problem</h1>
  <p>and</p>
  <p>Description Resource    Path    Location    Type</p>
  <h1>256 type name is not allowed   main.c  /ACC    line 45 C/C++ Problem</h1>
  <p>What I´m missing?? I tryed to assign the value inside the function as:</p>
  <pre><code>uint16_t begin( accel_odr aODR);
  </code></pre>
  <p>aODR = A_ODR_50;</p>
  <p>but I did´t solve the problem.</p>