編譯器是在MPLAB 8 GCC,dsPIC33系列版本3.30c缺少括號圍繞初始化
// Note: the first block below generates no error's with the compiler, but the data
// in the structurer is wrong.
// the 2nd block give warning, but the data is correct... why??
// NMEA2000.c:289: warning: missing braces around initializer
// NMEA2000.c:289: warning: (near initialization for 'static_can_filter[0]')
const tSCF static_can_filter[] = {
{(uint32) 0x01FFFFFF}, {(uint8) 2}, // Filter 0 (Process data)
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 1
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 2 (receive P2P-Message)
{(uint32) 0x0000FF00}, {(uint8) 2}, // Filter 3 (receive P2P-Message)
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 4
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 5
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 6
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 7
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 8
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 9
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 10
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 11
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 12
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 13
{(uint32) 0x00000000}, {(uint8) 2}, // Filter 14
(uint32) 0x00000000}, {(uint8) 2} // Filter 15
};
const tSCF static_can_filter[] = {
(uint32) 0x01FFFFFF, (uint8) 2, // Filter 0 (Process data)
(uint32) 0x00000000, (uint8) 2, // Filter 1
(uint32) 0x00000000, (uint8) 2, // Filter 2 (receive P2P-Message)
(uint32) 0x0000FF00, (uint8) 2, // Filter 3 (receive P2P-Message)
(uint32) 0x00000000, (uint8) 2, // Filter 4
(uint32) 0x00000000, (uint8) 2, // Filter 5
(uint32) 0x00000000, (uint8) 2, // Filter 6
(uint32) 0x00000000, (uint8) 2, // Filter 7
(uint32) 0x00000000, (uint8) 2, // Filter 8
(uint32) 0x00000000, (uint8) 2, // Filter 9
(uint32) 0x00000000, (uint8) 2, // Filter 10
(uint32) 0x00000000, (uint8) 2, // Filter 11
(uint32) 0x00000000, (uint8) 2, // Filter 12
(uint32) 0x00000000, (uint8) 2, // Filter 13
(uint32) 0x00000000, (uint8) 2, // Filter 14
(uint32) 0x00000000, (uint8) 2 // Filter 15
};
是否定義了「tSCF」? –