【发布时间】:2014-09-09 23:16:40
【问题描述】:
我正在尝试编译一段简单的代码,但我遇到了一个错误“无法为这个表达式生成代码”。 我适应了来自“http://www.barrysoft.it/blog/midi-with-pic-ausart.html”的代码
有人能告诉我这个问题吗?
MPLAB X IDE v2.15 xc8 v1.32
midi.c:
void midi_init(void)
{
/* MIDI uses 31250 baud/s serial speed */
uart_init(19, 1, 0, 0 ); //<---
}
midi.c:31: error: (712) can't generate code for this expression
uart.c:
void uart_init(unsigned char spbrg, unsigned bit brgh, unsigned bit sync, unsigned bit parity)
{
// Setup the baud rate
SPBRG = spbrg;
// High speed baud rate
BRGH = brgh; ////
// Synch or Async
SYNC = sync; ////
// 8bit transmission
TX9 = parity; ////
// Enable serial output
SPEN = 1;
// Enable UART out
TXEN = 1;
}
uart.c:29: error: (712) can't generate code for this expression
uart.c:32: error: (712) can't generate code for this expression
uart.c:35: error: (712) can't generate code for this expression
uart.h:
void uart_init(unsigned char spbrg, unsigned bit brgh,unsigned bit sync,unsigned bit parity);
无法解析标识符位,这似乎是 MPLAB IDE 错误,可以将其关闭。
【问题讨论】:
标签: ide microcontroller microchip mplab