Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.
  __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.

share|improve this question
    
Here's the sort of question you'd find in an IQ test: find one thing the problematic lines have in common. –  Armandas May 6 '12 at 16:21
    
@Armandas I was going to answer read- or writeprotection :) –  varesa May 6 '12 at 16:29

1 Answer 1

up vote 7 down vote accepted

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).

share|improve this answer
    
Oh wow, good one. This is one of those problems you can stare at for a whole day and never figure out. –  AngryEE May 6 '12 at 23:27
    
@AngryEE I once typed |= instead of != in a condition. Now that took me a while to find. –  Armandas May 7 '12 at 5:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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