Search:

Type: Posts; User: sonnichs

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    1,779

    Ok and thanks for this useful input. I guess I...

    Ok and thanks for this useful input. I guess I was expecting too much of the linker.
    I added the modifications using "extern" however I preferred to move this extern to the called module. This...
  2. Replies
    3
    Views
    1,779

    Sharing an object between separate modules

    I have compiled (with g++) and run the code "combined.cpp". It consists of the class LIBS, main and funct_correlation. A LIBS object is created as "L". Then main invokes L.getHABlib....
  3. Replies
    5
    Views
    5,004

    Thanks for your prompt response John. I am...

    Thanks for your prompt response John. I am working on PIC18s with the xc compiler which are little-endian. Darn-I have had my share of reversing bytes before!
    Your construct makes sense. I don't...
  4. Replies
    5
    Views
    5,004

    casting 4 chars to long int

    I am trying to move a 4 byte char buffer into a 32bit integer. No conversion--just move it.
    I have the stretch of code below:
    ==========================================
    char buff[4];
    buff[0] =...
  5. Sorry for the delay here-I spent most of...

    Sorry for the delay here-I spent most of yesterday dealing with an errant 3D printer. At any rate I was trying save you having you look at my code using pseudo code but it lead to confusion and I...
  6. Determining operator at run time efficiently (without "if')

    I have the stretch of pseudocode below. We have a very long running loop and the code needs to be highly efficient. We need to run the function using either "<" or ">" depending upon circumstances...
  7. Replies
    5
    Views
    6,675

    Thank you Salem----watching with top is a good...

    Thank you Salem----watching with top is a good idea--I will do that once I get this all running
    cheers
    fritz
  8. Replies
    5
    Views
    6,675

    Salem- I should have added, that the ancillary...

    Salem- I should have added, that the ancillary tasks run quickly, opening the serial port and finishing well before the main task shuts down the power supply and sleeps.
    I tried "system" and it...
  9. Replies
    5
    Views
    6,675

    Starting Programs from a C program in Linux

    I have a C program running on Ubuntu that starts up a power supply for a period of time and then stops it. During this period I need to start some ancillary programs on the same linux machine that...
  10. Thanks for the reply. I have done it this way in...

    Thanks for the reply. I have done it this way in the past and I guess its easier to understand (for me) rather than the type casting methods which seem prevalent in a lot of vendor code. Ultimately...
  11. typecasting and passing variable sized parameters to a subroutine

    I am dealing with an ADC that requires from 1 to 4 byte register writes to set its parameters. I want just one routine (not 4) to handle all cases. So I have 1 to 4 byte register updates cast as a...
  12. Replies
    3
    Views
    465

    OK and thanks for the offer! Regarding...

    OK and thanks for the offer!

    Regarding padding-I guess the answer you pose is that C will try to preserve the numerical value of what is being cast to a larger bit pattern. (I am big endian here)....
  13. Thanks for the good question Salem. I...

    Thanks for the good question Salem.

    I am configuring an Analog Devices AD7793 converter. It has various length registers that must be written, from 1 to 4 bytes. So I want just one generic...
  14. Replies
    3
    Views
    465

    typecast and padding

    Is there an "official" document somewhere that describes a standard for padding during typecasting.For example I am using:

    uint16_t var1 = 0xEEFF;
    uint32_t var2;

    then
    var2 = (uint32_t)var1;...
  15. OK. The (uint8_t*) typecast worked. I...

    OK.
    The (uint8_t*) typecast worked.
    I had been doing it wrong with (uint8_t) but now I understand.

    So-your explanations of the reasons for datatyping an address make sense.

    thanks for...
  16. passing variable sized parameters to a subroutine

    I am trying to write a subroutine that can accept variables of 1,2 or 4 bytes, e.g the variables to be passed can be type uint8_t,uint16_t and uint32_t.

    The prototype is:
    int ADC( uint8_t...
  17. Replies
    19
    Views
    8,098

    "magically be transformed to a negative number"...

    "magically be transformed to a negative number"
    Yuk-now I remember while I used to have the patience to suffer with assembler!
  18. Replies
    19
    Views
    8,098

    Hmmmm-the reason I did not want to use unsigned...

    Hmmmm-the reason I did not want to use unsigned was because the serial port routines on this processor complain about it. However, when I set my long int to X'11FFFFFFFF', the result in the buffer is...
  19. Replies
    19
    Views
    8,098

    Thanks grumpy and sorry about the conversion...

    Thanks grumpy and sorry about the conversion error for 6844.

    My long int is always under 65x10^6 (e.g. less than 80000000) so I assume I don't need to worry about signs.

    I settled on a...
  20. Replies
    19
    Views
    8,098

    One thing that I didnt' mention is that the...

    One thing that I didnt' mention is that the receiving machine is a spectrometer-I don't have access to its code etc. The compiler/microprocessor that I am using does not support htonxx() routines.
    ...
  21. Replies
    19
    Views
    8,098

    Thanks for the replies. I gained my expertise...

    Thanks for the replies. I gained my expertise (now long gone!) on Univacs, 370s and Solaris. I am pretty sure these were big-endian. I will play it safe and not rely on an given byte order as my code...
  22. Replies
    19
    Views
    8,098

    long integers and byte order

    I was preparing to send some bits down a serial port and I did a very simple thing. The bits were defined in a long int like this: long int lngint=19114957L;
    The hex representation of this...
  23. Replies
    17
    Views
    25,544

    "The actual representation of an int as a decimal...

    "The actual representation of an int as a decimal or hex, is just the graphical representation of that binary format"

    I really like that way of expressing it!

    I used to write mostly in...
  24. Replies
    17
    Views
    25,544

    Ah-didn't know about the code rule-sorry. ...

    Ah-didn't know about the code rule-sorry.

    Thanks for the answer-works fine! I wouldn't have thought of using a "print" command to convert data but if the shore fits---------

    Cheers
    Fritz
  25. Replies
    17
    Views
    25,544

    need function to convert int to hex

    I am loading some integers and long integers into a string as hexidecimal. For example:

    int I 1234;
    str char[2];
    Then funct(I) returns:
    str[0]=0x04 and str[1]=0xD2

    I have written the...
Results 1 to 25 of 30
Page 1 of 2 1 2