1
\$\begingroup\$
  __CONFIG(0, 0xFFFF);
  __CONFIG(1, FOSC_HS  );
  __CONFIG(2, BOREN_OFF);
  __CONFIG(3, WDTEN_OFF);
  __CONFIG(4, 0xFFFF);
  __CONFIG(5, 0xFFFF);
> __CONFIG(6, CP0_OFF && CP1_OFF);
> __CONFIG(7, CPB_OFF && CPD_OFF);
> __CONFIG(8, WRT0_OFF && WRT1_OFF);
> __CONFIG(9, WRTC_OFF && WRTB_OFF && WRTD_OFF);
> __CONFIG(10, EBTR0_OFF && EBTR1_OFF);
  __CONFIG(11, EBTRB_OFF);

The rows that I have marked cause a syntax error while building, others are fine.

C:\Users\Oppilas\AppData\Local\Temp\s6bc.:14: error: syntax error

I am using HI-TECH PICC-18 PRO v9.66, lite mode.

\$\endgroup\$
2
  • \$\begingroup\$ Here's the sort of question you'd find in an IQ test: find one thing the problematic lines have in common. \$\endgroup\$
    – Armandas
    May 6, 2012 at 16:21
  • \$\begingroup\$ @Armandas I was going to answer read- or writeprotection :) \$\endgroup\$
    – varesa
    May 6, 2012 at 16:29

1 Answer 1

7
\$\begingroup\$

OK, I thought I'll answer properly :)

The && is a logical operator and the result is boolean. This does not make any sense in this case. What you need is & (a bit-wise operator).

\$\endgroup\$
2
  • \$\begingroup\$ Oh wow, good one. This is one of those problems you can stare at for a whole day and never figure out. \$\endgroup\$
    – AngryEE
    May 6, 2012 at 23:27
  • \$\begingroup\$ @AngryEE I once typed |= instead of != in a condition. Now that took me a while to find. \$\endgroup\$
    – Armandas
    May 7, 2012 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.