Search:

Type: Posts; User: ridgerunnersjw

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Yes that is a constant array of constant size and...

    Yes that is a constant array of constant size and a loop sounds good....was thinking there was some simple 'function' I could call
  2. Quick method for finding where a value fits in an integer array of fixed size??

    Hello...
    Can someone tell me other than doing a bunch of conditional if statements is there a quick way to have a function take an integer argument then compare it to integers within a fixed array...
  3. Replies
    2
    Views
    520

    strncmp how to?

    Trying to use the following unsuccessfully...This is the argument for an if statement....if 0 do ....Can someone tell me what I may be doing wrong here as I never enter it....*p = "ER_CMD#P?"

    ...
  4. Replies
    4
    Views
    489

    unsigned int rollover?

    If I am decrementing an unsigned int (16 bits) by a value say

    k -=15;

    what happens the next time around if k is sitting at a 4? Seems it would roll over to 65524....Is this correct? Can I...
  5. Replies
    2
    Views
    218

    Thanks

    Thanks
  6. Replies
    2
    Views
    218

    memcpy usage

    Is there a way to :

    memcpy(m, k, sizeof(m))

    where m[6] and k is much larger but you want to copy just a subset?

    ie
    something like
    memcpy(m, k[3], sizeof(m)) where it starts at element k[3]
  7. How to return a pointer from a function in another file?

    I have a function that returns a pointer....I have labeled it with and without "static". In both cases when the function gets called again I lose the value of the pointer in the previous call, even...
  8. how to de-reference from a pointer of values

    const char *configCmd[] = {r_Spread1, r_PowerSet5, r_bandSet, r_USAFCC, r_radioRst, r_getBandPlan, r_serialNumber, r_getPwr, r_spreadFactor};//, r_serialNumber};


    const char *pTx;

    question 1: ...
  9. declaration extern --- defn in function

    Can I declare a variable in .h file with extern, then use it in main (a.c) BUT it gets defined in a function that exists in b.c? Said function get's called from main....

    Thanks
  10. Replies
    4
    Views
    403

    Here is an unsigned int returned from a function...

    Here is an unsigned int returned from a function (within a structure)...I am trying to test to see if ANY one of the bits has been set not sure whether to use & or &&???


    (swInfo.twoSec & 0x00FE)...
  11. Replies
    4
    Views
    403

    I understand that but if I want to check for a...

    I understand that but if I want to check for a value do I use the first or the second....I keep getting confused....

    if (variable & 0x0F) .....Seems to me that here if ANY bit in the lower nibble...
  12. Replies
    4
    Views
    403

    conditional question

    Good morning....
    Can someone please tell me the difference between

    if (variable = 0)

    and

    if (variable == 0)
  13. I just want to say Thank you! The code examples...

    I just want to say Thank you! The code examples you sent work great.....
  14. Thank you! I look forward tomorrow giving your...

    Thank you! I look forward tomorrow giving your stuff a try.....It's complicated from this end because this is embedded code on a microprocessor so hardware ISRs are constantly going off and both...
  15. Help....Trying to use extern / static to no avail....

    I have four global variables defined before main in file1.c

    boolean moreThanOneSwitch = F, moreThanOneSwitchTwoSec = F;unsigned int switchHits[12] = {0}, button = 0;




    I declare these...
  16. Replies
    2
    Views
    379

    The problem is the function is getting called at...

    The problem is the function is getting called at the beginning of wakeup every time HOWEVER my main code relies on the functions previous call return values to make some decisions THEN clear out all...
  17. Replies
    2
    Views
    379

    rtn value from function question

    I have two files....main.c and func.c
    I want to initialize a value globally in main.c
    I want to send func.c parameters and for a function within that file to be able to see (not pass) the global...
  18. Compiler warning....what does it mean and how do I cast to fix it

    The following line of code generates a warning:
    code:

    memcpy(noCRC, pRx, 4);



    warning:
    argument of type "volatile char *" is incompatible with parameter of type "const void...
  19. Great I will try it.....So that compares the...

    Great I will try it.....So that compares the lvalues of the two?
  20. comparing the address of a pointer to an array address for size

    Good afternoon....
    Is it possible to compare the address of a pointer to the address of an array as it is incremented for use as a pointer....so instead of counting with a variable and reaching...
  21. Replies
    5
    Views
    400

    *(&incoming) unsigned char[20] [69 'E',82 'R',95...

    *(&incoming) unsigned char[20] [69 'E',82 'R',95 '_',67 'C',77 'M'...] 0x002000
    [0] unsigned char 69 'E' 0x002000
    [1] unsigned char 82 'R' 0x002001
    [2] unsigned char 95 '_' 0x002002 ...
  22. Replies
    5
    Views
    400

    When I look at expression testcmd in the debug...

    When I look at expression testcmd in the debug window I do NOT see a \0 at the tail...The pRx is a pointer to a volatile char incoming[20]....This array is oversized and filled with 0x00....So I am...
  23. Replies
    5
    Views
    400

    strcmp help please

    I cannot seem to get the following command to trigger. I see the UART characters on a digital analyzer so I know the characters are there. pRx gets updated in a UART ISR, therefore the...
  24. But the char r_getVersion.....is one of MANY...

    But the char r_getVersion.....is one of MANY commands that I will be sending to a piece of hardware...I don't want to clutter my source file with these constants....Is there a way to keep these in...
  25. junk.h file is really void config(void)

    junk.h file is really void config(void)
Results 1 to 25 of 39
Page 1 of 2 1 2