Hi Phatline,
I don't remember, sorry, just try.
memcpy(PB[track], &PB8, sizeof(PB8));
memcpy is copying a given length of data from an address to an other address
PB is already a Pointer then this code may work.
Tell me back I want to be sure.
You can try to write your 256 16bit values directly.
#define STEP_NUM 256
u16 PB[STEP_NUM];
//populate PB
//...
//write PB
for(i=0; i<STEP_NUM ; i++)FILE_WriteHWord(PB[i]);
By using structures union?
//Definitions
#define TRACK_NUM 16
#define STEP_NUM 256
//Type
typedef union {
struct {
u16 data;
};
struct {
u8 datas[2];
};
struct {
u8 data_l;
u8 data_h;
};
} data_t;
.....
//Vaiable
data_t PB[TRACK_NUM][STEP_NUM];
.....
//Using
PB[track][step].data = (u16)pitchbend;
//or
PB[track][step].datas[0] = (u8)(pitchbend & 0xff);
PB[track][step].datas[1] = (u8)(pitchbend >> 8);
//or
PB[track][step].data_l = (u8)(pitchbend & 0xff);
PB[track][step].data_h = (u8)(pitchbend >> 8);
Best