- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I temporarily moved the LEDs that were driven by a control register so I could use them for some other testing, and because the control register is now optimized out of the design, all of the functions referencing it now are broken, and I have to go through all my code removing them to get it to build.
If a control register (or other component) is optimized out of the design, its API functions should be replaced with do-nothing functions and this should be be indicated with warnings, not by breaking the whole project.
Solved! Go to Solution.
- Labels:
-
PSoC Creator & Designer Software
- Tags:
- suggestion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JoBr,
If you can afford the CR resources, you can always leave them in the design even if you don't have LEDs attached anymore.
BTW: You can use GPIO register calls to drive LEDs.
Pin_LEDs_Write(one_bit_4_each_LED);
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JoBr,
If you can afford the CR resources, you can always leave them in the design even if you don't have LEDs attached anymore.
BTW: You can use GPIO register calls to drive LEDs.
Pin_LEDs_Write(one_bit_4_each_LED);
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The CR is still in the design, but the build optimizes it out because it doesn't go anywhere anymore. In that case, the API functions should not fail, since the component is still in the schematic. They should just do nothing, since the component does nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JoBr,
I fully agree with you. If you put a CR, it should be there if it fits. This means all the APIs as well.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah it's fine to optimize it out, but don't break the build in the process. When a regular function is unused, it gets optimized out by the compiler, but it doesn't just cease to exist and break the build.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JoBr,
Alternatively, you can disable hardware optimization (Project->Build->..)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah but I'm just trying to test something quickly, it shouldn't cause all these other side effects to just disconnect the output of a component.