0

I have a device made with ATtiny861, programmed with CodeVision AVR ver. 2.60. I need to entirely erase the EEPROM (set it to FFs). From the documentation I copy and paste the following code:

int eeprom *eepromp;
// some code...
main( void ) {
// some code...
for( eepromp=0; eepromp<=0x01FF; eepromp++ )
  *eepromp = 0xFF;
// some code...

But the compiller gives me the following error: *Error: D:\work\projects\Radius(MPT)\control\code2\mpt.c(415): operand types 'eeprom int ' and 'int' are incompatible with the '<=' operator

Documentation can be found at the address: https://instruct1.cit.cornell.edu/courses/ee476/codevisionC/cvavrman.pdf The page containing the example: 84

1 Answer 1

1

The error message says that you can't compare eeprom int (the type of the eepromp variable) and plain int (the type of the literal 0x1ff).

Either cast eepromp or the integer literal to the others type, or have an int eeprom variable with the end address that you compare to.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, @Joachim! It worked!!! Now the code in 'for' section is for( eepromp=0; eepromp<=(int eeprom*)0x01FF; eepromp++ )

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.