@agent_orange
Thanks again a lot! I think i´ve got it mostly. I made for test some handy defines:
#define HIGHBYTELONG(x) ((byte)((x) >> 24))
#define LOWBYTELONG(x) ((byte)((x) >> 16))
#define HIGHBYTE(x) ((byte)((x) >> 8))
#define LOWBYTE(x) ((byte)((x) & 0x00ff))
#define WORD(x,y) (( ( (byte)(x) ) << 8) | ((byte)(y)))
unsigned long int ulnumber = 0xABCDEF89;
void setup()
{
Serial.begin(9600);
Serial.println(ulnumber, HEX); // prints value as string in binary (base 2)
byte hbl = HIGHBYTELONG(ulnumber);
Serial.println(hbl, HEX);
byte lbl = LOWBYTELONG(ulnumber);
Serial.println(lbl, HEX);
byte hb = HIGHBYTE(ulnumber);
Serial.println(hb, HEX);
byte lb = LOWBYTE(ulnumber);
Serial.println(lb, HEX);
unsigned int wi = WORD(hbl,lbl);
Serial.println(wi, HEX);
unsigned int wi2 = WORD(hb,lb);
Serial.println(wi2, HEX);
unsigned long int wix = (( (((unsigned long int) wi) <<16)) | ((unsigned int) wi2));
Serial.println(wix, HEX);
}
void loop()
{
}
i get the following output:
ABCDEF89
AB
CD
EF
89
ABCD
EF89
ABCDEF89
i took hex numbers, so you can see it directly if it works correct.
But i could not make a working define for the unsigned long int
directly. But for now i have what i need to go on.
Thanks a lot again!
Made yesterday in the late evening a little walk with the raw boxed logger device. It worked so far. But i must have had some worse serial connector or the cold was to much, @-4Celsius. Many track point missed caused by worse checksums, also the serial connection had too much failures or the mmc? . I´ll make today a walk again.
The sd_raw write works really fine now, but it is much more slower than the gps. I expected it been faster than the gps. So i changed for test the buffer to 512bytes, thats the bulk it always wants to write i think.
i´ll post that code later.
--- more info to come
added a missing "#" in code section