- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your suggestion