столкнулся с проблемой, рассматривая пример с атмеловского сайта AVR315 - TWI
но похоже из-за разных версий, что то в иаре изменилось.
в main написано:
Код
#include <iom128.h>
#include <inavr.h>
#include "TWI_Master.h"
...
switch ( pressedButton )
{
// Send a Generall Call
case (1<<PD0):
messageBuf[0] = TWI_GEN_CALL; // The first byte must always consit of General Call code or the TWI slave address.
messageBuf[1] = 0xAA; // The command or data to be included in the general call.
TWI_Start_Transceiver_With_Data( messageBuf, 2 );
break;
#include <inavr.h>
#include "TWI_Master.h"
...
switch ( pressedButton )
{
// Send a Generall Call
case (1<<PD0):
messageBuf[0] = TWI_GEN_CALL; // The first byte must always consit of General Call code or the TWI slave address.
messageBuf[1] = 0xAA; // The command or data to be included in the general call.
TWI_Start_Transceiver_With_Data( messageBuf, 2 );
break;
а линкер ругается на PD0
Код
Error[Pe020]: identifier "PD0" is undefined C:\Program Files\IAR Systems\Embedded Workbench 5.3\avr\myTWImaster\main.c 95
хотя в iom128.h
есть вот что:
Код
#define PD0 0
Помогите пжалста разобраться.
в св-вах проекта указал нужный камень.
в проект принудительно добавил нужные файлы iom128.h.
все, вопрос решился просмотром внимательным iom128.h
решилось вставкой след строчки перед инклюдами
Код
#define ENABLE_BIT_DEFINITIONS