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...
Type: Posts; User: sonnichs
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...
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....
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...
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] =...
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...
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...
Thank you Salem----watching with top is a good idea--I will do that once I get this all running
cheers
fritz
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...
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...
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...
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...
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)....
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...
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;...
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...
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...
"magically be transformed to a negative number"
Yuk-now I remember while I used to have the patience to suffer with assembler!
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...
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...
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.
...
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...
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...
"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...
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
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...