Author |
Message |
Topic: How to suppress warning: "Condition always FALSE" |
septillion
Replies: 19
Views: 61231
|
Forum: General CCS C Discussion Posted: Wed Oct 05, 2016 9:32 am Subject: How to suppress warning: "Condition always FALSE" |
Like the ALL_CAPS rule
And here indeed a loop was completely misplaced. But what about a piece of expandable code?
#define NUMBER_CONNECTED 3
for(i = 0; i < NUMBER_CONNECTED; i++& ... |
Topic: How to suppress warning: "Condition always FALSE" |
septillion
Replies: 19
Views: 61231
|
Forum: General CCS C Discussion Posted: Wed Oct 05, 2016 6:36 am Subject: How to suppress warning: "Condition always FALSE" |
Consider this example:
#define ADC_setUpAdc() setup_adc(ADC_CLOCK_INTERNAL);\
setup_adc_ports(AN0_TO_AN2);
if(someCondition)
ADC_setU ... |
Topic: How to suppress warning: "Condition always FALSE" |
septillion
Replies: 19
Views: 61231
|
Forum: General CCS C Discussion Posted: Sun Oct 02, 2016 3:01 pm Subject: How to suppress warning: "Condition always FALSE" |
.
Since 0 is always FALSE, the loop will never occur.
No it does not. The loop will occur exactly once. ;)
But that still leaves me with why? It's just
#define ADC_setUpAdc() setup_a ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Fri Sep 30, 2016 7:29 am Subject: Different levels of indirection |
Thanks for testing! I will give it a try once I'm back home. Did not bring my PicKit 2 with me.
I first wanted to say a int1 is just defined as a int8 but then I saw that's only the case if the com ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 4:08 pm Subject: Different levels of indirection |
Mm, true, but the fact it's scaleable is worth it
I'm using 5.008, on old Uni license.... It's a bug there? :/ |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 1:33 pm Subject: Different levels of indirection |
Like I said, old project, good old 16F628A (/648A)
And yeah, I thought it would be something like that. Didn't dive into it So yeah, for compatibility it should be int16 but for the 16F ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 12:49 pm Subject: Different levels of indirection |
Why is it a int16? It's just defined as a macro. And on a PIC16F648A/628A it's a number between 40 and 55. This might be different for other PICs but at least for the 16F648A I don't see a problem. We ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 10:24 am Subject: Different levels of indirection |
Thanks for explaining guys!
Alright, I tried to change my small library to use pass by pointers instead of pass by reference. So I change all the references to pointer (from &b to *b) and all t ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 8:21 am Subject: Different levels of indirection |
First of all, thanks guys!
I'm indeed more of a C++ guy I started with PIC but moved to AVR (or ARM now) because of the open tool chains. But this is still an old project I want to revise wh ... |
Topic: Different levels of indirection |
septillion
Replies: 15
Views: 55392
|
Forum: General CCS C Discussion Posted: Wed Sep 28, 2016 4:50 am Subject: Different levels of indirection |
Hi all,
After some time not working with PICs I tried to make a new program for an older project. But I keep running into this error.
In my project I want to pass a struct to a function. No prob ... |
Topic: Servo Position Control Problem |
septillion
Replies: 2
Views: 3710
|
Forum: General CCS C Discussion Posted: Sun Jan 24, 2010 8:54 am Subject: Servo Position Control Problem |
delay_ms expects a int16 value, not a float. 0.5 won't work. |
Topic: Preform an action on a string |
septillion
Replies: 3
Views: 3803
|
Forum: General CCS C Discussion Posted: Sat Jan 23, 2010 1:02 pm Subject: Preform an action on a string |
That was me, not knowing I was posting as a guest... |
Topic: Preform an action on a string |
septillion
Replies: 3
Views: 3803
|
Forum: General CCS C Discussion Posted: Thu Jan 21, 2010 6:25 am Subject: Preform an action on a string |
16F628A
PCM 4.057
Hi,
I try to kind of port a AVR GCC pice of code to CCS but i can't get it to work.
The pice of GCC code:
void display_str(char *s) {
uint8_t i;
// don' ... |
|