PRT0DR Error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi guys,

   

When I run below code, if lope is working but else loop is not working. But if x deleted and 0 wrote instead of x, it is working. 

   

I can not see the failure.. Do you have an idea ? (device is CY8C21434 and code is entering else and if loop)

   

        int x;

   

if (ENABLE == b_value)

   

{

   

*((&PRT0DR) + 0) |= 0x01;

   

}

   

else 

   

{

   

x = 0;

   

*((&PRT0DR) + x) &= ~(0x01);

   

}

0 Likes
4 Replies
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

Not sure but if x is an int, 16 bits, the address space of PSOC 1 is limited to 32KB,

   

is compiler losing it on the implied cast ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I changed to BYTE x; and tried again. But problem is not solved. I think that is not cast problem. PSoc compiler may not be ANSI C.  ((&PRT0DR) + x) is ordinary address operations. 

   

Is there someone who has been faced with this problem?

0 Likes
ETRO_SSN583
Level 9
Level 9
100 sign-ins 5 likes given 1000 replies posted

You might file a CASE on this -

   

 

   

To create a technical or issue case at Cypress -

   

 

   

www.cypress.com

   

“Support”

   

“Technical Support”

   

“Create a Case”

   

 

   

You have to be registered on Cypress web site first.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks for your suggestion 

0 Likes