[En-Nut-Discussion] Byte select macros

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Nov 24 14:35:28 CET 2010


>>>>> "Bernard" == Bernard Fouché <bernard.fouche at kuantic.com> writes:

    Bernard> changing to: extern unsigned char res[];

Try it like
#include <stdint.h>

extern  uint64_t lwdata[];

void target_data4_req(uint8_t *canFrame_Tx, uint8_t index)
{

    canFrame_Tx[0] = lwdata[0] & 0xff;
    canFrame_Tx[1] = lwdata[0] >>   8;
    canFrame_Tx[2] = lwdata[0] >>  16;
    canFrame_Tx[3] = lwdata[0] >>  24;
    canFrame_Tx[4] = lwdata[0] >>  32;
    canFrame_Tx[5] = lwdata[0] >>  40;
    canFrame_Tx[6] = lwdata[0] >>  48;
    canFrame_Tx[7] = lwdata[0] >>  56;

}

and look yourself...
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list