Expected Initializer error?

On compiling the code, I get an error:

exit status 1
expected initializer before 'captured_bit_count'

int DataIn = 8;
uint8_t capt;
uint16_t last_capture;
uint16_t maxCaptureTimeLow;
uint32_t maxTDefaultRead;
extern uint16_t capture_data[SIZE];
extern uint16_t capture_valid[SIZE];
extern uint16_t pulse_length[SIZE];
extern uint8_t bit_pos;
extern uint8_t last_bit;
extern uint8_t edge; //manchester
extern uint8_t last_valid;
volatile uint8_t byte captured_bit_count;
volatile uint8_t byte captured_cnt;
volatile uint8_t byte pulse_cnt;
volatile uint8_t byte running_one;

I want to use the register keyword like this - register uint8_t captured_bit_count asm ("r9");

But it seems like its not going to happen - http://forum.arduino.cc/index.php?topic=281265.0

volatile uint8_t byteTake two types into the shower?

I declare it as a volatile byte then? :confused:

Or volatile uint8_t. But it can't be both.

I just realized how dumb the mistake was. Below is another error. I know that usually this error happens if I missed a brace or so. But I can’t really find any.


  //edge = TCCR1B; manchester
  //TCCR1B = edge ^ (1<<ICES1); manchester
  TCCR1B ^= 1<<ICES1; (//toggle the
  static byte lastEdge; - [b]ERROR HERE ------>exit status 1; expected primary-expression before 'static'[/b]
  byte thisedge = OCR1A; //TOP VALUE
  //byte difference = lastEdge - thisEdge;
  byte capt = thisEdge - lastEdge;
  lastEdge = thisEdge; //counter free running
  if (difference < ) {}
  else TODO
  lastEdge = thisEdge;


The code is incomplete as it is still in under development.

CR1B ^= 1<<ICES1; (// there you go.
Comments rarely go in brackets.

:zipper_mouth_face: I swear to God, I am having a very bad day.

This is also nice :wink:

if (difference < ) {}

And you're missing a ';' after the expression 'TODO'

  else TODO


I bet he's actually missing a // in front of the TODO.

I bet he's actually missing a // in front of the TODO.

I'm betting on his not having a clue. 8)