The following declarations work OK (meaning the content of Config1 is "1000" if interpreted as word):
Code: Select all
const ReportDescriptor: array[1000] of byte = (
0x06,
0xA0
// ....
);
const Config1 : array[2] of byte = (
Lo(SizeOf(ReportDescriptor)),
Hi(SizeOf(ReportDescriptor))
);
Code: Select all
const ReportDescriptor: array[1000] of byte = (
0x06,
0xA0
// ....
);
const Config1 : array[2] of byte = (
Lo(word(SizeOf(ReportDescriptor))), // <-------- typecast
Hi(word(SizeOf(ReportDescriptor))) // <-------- typecast
);
Code: Select all
;HiLo.mpas,16 :: _Config2
0x04AA 0x0000 ;_Config2+0
; end of _Config2
;HiLo.mpas,11 :: _Config1
0x04AC 0x03E8 ;_Config1+0
; end of _Config1
Code: Select all
const ReportDescriptor: array[50] of byte = ( // <--- value <256 now
0x06,
0xA0
// ....
);
const Config1 : array[2] of byte = (
Lo(SizeOf(ReportDescriptor)),
Hi(SizeOf(ReportDescriptor)) // <-------- compilation error
);
Thanks in advance!