Search:

Type: Posts; User: danlee58

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    781

    My compiler doesn't recognize size_t as a...

    My compiler doesn't recognize size_t as a variable type, and it gives me this warning:

    warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    warning: incompatible...
  2. Replies
    12
    Views
    781

    This is NOT an assignment. This is for a real...

    This is NOT an assignment. This is for a real piece of hardware. I understand the code that nonpuz posted, and I use similar code in other sections of this program.
  3. Replies
    12
    Views
    781

    nonpuz, Thanks for your help. I have already...

    nonpuz,

    Thanks for your help. I have already made a change to the second if condition. I changed 'return (p);' to 'return (RANGE_ARRAY[p]);'. I have tested it in a static condition and it returns...
  4. Replies
    12
    Views
    781

    I found one mistake and fixed it. int POLL...

    I found one mistake and fixed it.



    int POLL (int *RANGE_ARRAY) {

    int d = 0;
    int e = 0;
    int f = 0;
    int g = 0;
  5. Replies
    12
    Views
    781

    I didn't say it is correct, I said it compiles. I...

    I didn't say it is correct, I said it compiles. I have to download it into my equipment, which is out in the cold, to test it.

    The integers are [0, 7].

    This is the way I came up with to do the...
  6. Replies
    12
    Views
    781

    Polling an Array

    I want to find the value occurs most in an 8 integer array. Here is the code that I have. It does compile, but has not been tested.




    int POLL (int *RANGE_ARRAY) {

    int d = 0;
    int e =...
  7. It's only supposed to jump as TPS_INDEX changes,...

    It's only supposed to jump as TPS_INDEX changes, but it changes when TPS_INDEX is steady.

    I got an answer to my question. I don't need a break or default after the last case. My Switch/Case code...
  8. It's an Infinite Loop. It tests TPS_INDEX against...

    It's an Infinite Loop. It tests TPS_INDEX against different tables, based on INDEX, and changes INDEX based on the results of the test. It's a basic Elevator program, where INDEX is the current...
  9. I hope that this is better! int INDEX =...

    I hope that this is better!




    int INDEX = 1;


    While(1) {
  10. Sorry, I copied it from Notepad++. All the...

    Sorry, I copied it from Notepad++.

    All the indentations got messed up. Notepad++ tracks the brackets.

    I'll try to repost it with indentations.
  11. Program Jumps Between Cases Without Reason

    This program seems to jump between cases without any reason.





    INDEX = 1;


    While(1) {
  12. Replies
    13
    Views
    934

    Excuse me for jumping into this thread, but I...

    Excuse me for jumping into this thread, but I have a problem with a Switch/Case. I have a while loop, but the code seems to jump between cases without any reason.

    Do you need the last break at the...
  13. Replies
    6
    Views
    690

    This code used to work properly, but in editing...

    This code used to work properly, but in editing it to fix something else, that initialize statement must have been deleted.
  14. Replies
    6
    Views
    690

    grumpy, Thanks! I think that you have found...

    grumpy,
    Thanks!
    I think that you have found the problem, in spite of me not showing enough of the code. I neglected to Initialize i. i is used in several other similar routines, and is initialized...
  15. Replies
    6
    Views
    690

    Lookup Table Problem

    I have a 10 term array that I use as a lookup table.


    const int array[10] (0, 1, 2, 3, 4, 5, 6, 7, 8, 9);

    This is the routine that I call to get a number from that table.


    int LOOKUP (int...
  16. Thread: Nested Switch

    by danlee58
    Replies
    10
    Views
    701

    You are right, and I have considered that myself,...

    You are right, and I have considered that myself, but I like to see the active code on one screen or page, so I don't have to jump back & forth while reading the code.

    The code that I posted is...
  17. Thread: Nested Switch

    by danlee58
    Replies
    10
    Views
    701

    I don't have a debugger. I have to compile & test...

    I don't have a debugger. I have to compile & test the code on the hardware. I use 'printf' to debug.

    I also don't have an editor that will track (, and ) or {. and }.
  18. Thread: Nested Switch

    by danlee58
    Replies
    10
    Views
    701

    I think that I see a problem here: case...

    I think that I see a problem here:



    case 4:
    if (A < E) //Do something }
    break;
    case...
  19. Thread: Nested Switch

    by danlee58
    Replies
    10
    Views
    701

    When I say that it gets lost, I mean that the...

    When I say that it gets lost, I mean that the hardware doesn't switch to the proper state, based on the input conditions. It starts out right, but when it gets to case 2 under case 4 it doesn't...
  20. Thread: Nested Switch

    by danlee58
    Replies
    10
    Views
    701

    Nested Switch

    I have a control program that uses a nested Switch Statement. It gets lost while executing the second Switch.

    The code looks like this:



    int A;
    int B = x; //B, C, D and E are constants...
  21. Replies
    10
    Views
    1,281

    The ROM size is 32K. I am whittling away a what...

    The ROM size is 32K. I am whittling away a what was > 1K more than the 32K. I asked the question to get some insight into the best way to code these decision blocks. They may not seem like much, but...
  22. Replies
    10
    Views
    1,281

    Code Efficiency

    I am working on a program where the code exceeds the ROM space by ~1K. I'm trying to reduce the size of my program.

    There is a lot of code that checks the state of a binary Flag.



    int flag =...
  23. Replies
    3
    Views
    5,501

    I did Google it myself, but none of the sites...

    I did Google it myself, but none of the sites that came up actually defined it.

    Thanks Mats, I understand it's function is to convert a 32 bit Signed Integer to Double Precision Floating Point.
    ...
  24. Replies
    3
    Views
    5,501

    What Is The Purpose of __floatsidf?

    When I compile a C program that I am working on, the .lst file shows some routines that I am not familiar with. One of these is __floatsidf.

    What does this routine do, and why do I need it in my...
  25. OK, that's it. I was passing a volatile integer...

    OK, that's it. I was passing a volatile integer to a non-volatile pointer. It's working now. Thanks.
Results 1 to 25 of 47
Page 1 of 2 1 2