【发布时间】:2019-04-20 14:59:39
【问题描述】:
我正在尝试编写一个可以驱动 LED 矩阵的头文件,但我遇到了无法解决的语法错误
我已经在我认为有必要的地方添加了“;”并检查了https://www.nongnu.org/avr-libc/user-manual/pgmspace.html
#ifndef max7219_H_
#define max7219_H_
#include <io.h>
#include <pgmspace.h>
#include <delay.h>
#include <stdint.h>
#define SLAVE_SELECT PORTB &= ~( 1<<PB4 );
#define SLAVE_DESELECT PORTB |= ~( 1<<PB4 );
char characters[96][5] PROGMEM =
{
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000
}
};
错误是: 错误: max7219.h(15), #included from: p2.c: ';'预计
第 15 行是 char 字符[96][5] PROGMEM = ...
【问题讨论】:
-
你能把
0b00000000改成0试试吗? -
char characters[96][5] PROGMEM无效。为什么要添加PROGMEM? -
@PaulOgilvie 你知道 AVR gcc 端口吗?
-
我看到
<avr/pgmspace.h>正在被使用 -
顺便说一句,前面的宏可能不应该有尾随
;,否则if不带大括号很容易出错...
标签: c avr atmega16 codevisionavr