This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pro2] WeatherDuino_P2AT328_RX_v4.0_b001 Compile error
#1
Hope someone can help with a compile error I am getting please?
 
WeatherDuino_P2AT328_RX_v4.0_b001
 
I am using a freshly installed copy of Arduino V 1.8.8, all libraries from the Rar archive have been copied to the Arduino library folder, the file will compile ok, until I change the line below in Config_options  to 1
 
 
// --------------------------------------------------------------------------------------
//   Define Software Operation Mode
// --------------------------------------------------------------------------------------
#define Work_Mode         1   // Mode 0= Davis VP2 Emulation Mode, Mode 1= EasyWeather Mode
 
The error relates to the DataFlash library.
 
Some of the error messages below.
 
C:\Users\lotus\Documents\Arduino\WeatherDuino_Pro2\v4.0\software\Receiver Software\WeatherDuino_P2AT328_RX_v4.0_b001\Routines.ino: In function 'int Ext_eepromReadInt(int)':
 
Routines:248:46: error: 'ExternalEeprom_read' was not declared in this scope
 
   value = value | ExternalEeprom_read(address) << 8;
 
                                              ^
 
C:\Users\lotus\Documents\Arduino\WeatherDuino_Pro2\v4.0\software\Receiver Software\WeatherDuino_P2AT328_RX_v4.0_b001\Routines.ino: In function 'void Ext_eepromWriteInt(int, int)':
 
Routines:255:53: error: 'ExternalEeprom_write' was not declared in this scope
 
   ExternalEeprom_write(address, (value >> 8) & 0xFF );
 
                                                     ^
 
Using library DataFlash in folder: C:\Users\lotus\Documents\Arduino\libraries\DataFlash (legacy)
exit status 1
'ExternalEeprom_read' was not declared in this scope


Thanks Andy
Reply
#2
Hello Andy,

Code:
// --------------------------------------------------------------------------------------
//   Define Software Operation Mode
// --------------------------------------------------------------------------------------
#define Work_Mode         1   // Mode 0= Davis VP2 Emulation Mode, Mode 1= EasyWeather Mode

Do you really want to run the receiver in EasyWeather Mode rather than Davis VP2 Emulation?

Indeed there is a compilation error when EasyWeather Mode is selected, but the fix is easy. If you really want to run the receiver in EasyWeather mode I can post the fix.
MeteoCercal - Air Quality Data
Click here to watch at my ThingSpeak channel



Reply
#3
(18-02-2019, 02:32)Werk_AG Wrote: Hello Andy,

Code:
// --------------------------------------------------------------------------------------
//   Define Software Operation Mode
// --------------------------------------------------------------------------------------
#define Work_Mode         1   // Mode 0= Davis VP2 Emulation Mode, Mode 1= EasyWeather Mode

Do you really want to run the receiver in EasyWeather Mode rather than Davis VP2 Emulation?

Indeed there is a compilation error when EasyWeather Mode is selected, but the fix is easy. If you really want to run the receiver in EasyWeather mode I can post the fix.

Yes please, if there is any easy fix I would be grateful if you could post it..

Many thanks..
Reply
#4
Routines.ino

Find and replace this:

Code:
// --------------------------------------------------------------------------------------
//   Read / Write a Int to External Eeprom
// --------------------------------------------------------------------------------------
int Ext_eepromReadInt(int address)
{
  int value = 0x0000;
  value = value | ExternalEeprom_read(address) << 8;
  value = value | ExternalEeprom_read(address + 1);
  return value;
}

void Ext_eepromWriteInt(int address, int value)
{
  ExternalEeprom_write(address, (value >> 8) & 0xFF );
  ExternalEeprom_write(address + 1, value & 0xFF);
}

with this:

Code:
// --------------------------------------------------------------------------------------
//   Read / Write a Int to External Eeprom
// --------------------------------------------------------------------------------------
#if Work_Mode == 0
  int Ext_eepromReadInt(int address)
  {
    int value = 0x0000;
    value = value | ExternalEeprom_read(address) << 8;
    value = value | ExternalEeprom_read(address + 1);
    return value;
  }
  
  void Ext_eepromWriteInt(int address, int value)
  {
    ExternalEeprom_write(address, (value >> 8) & 0xFF );
    ExternalEeprom_write(address + 1, value & 0xFF);
  }
#endif

Regards
MeteoCercal - Air Quality Data
Click here to watch at my ThingSpeak channel



Reply
#5
(21-02-2019, 02:34)Werk_AG Wrote: Routines.ino

Find and replace this:

Code:
// --------------------------------------------------------------------------------------
//   Read / Write a Int to External Eeprom
// --------------------------------------------------------------------------------------
int Ext_eepromReadInt(int address)
{
 int value = 0x0000;
 value = value | ExternalEeprom_read(address) << 8;
 value = value | ExternalEeprom_read(address + 1);
 return value;
}

void Ext_eepromWriteInt(int address, int value)
{
 ExternalEeprom_write(address, (value >> 8) & 0xFF );
 ExternalEeprom_write(address + 1, value & 0xFF);
}

with this:

Code:
// --------------------------------------------------------------------------------------
//   Read / Write a Int to External Eeprom
// --------------------------------------------------------------------------------------
#if Work_Mode == 0
 int Ext_eepromReadInt(int address)
 {
   int value = 0x0000;
   value = value | ExternalEeprom_read(address) << 8;
   value = value | ExternalEeprom_read(address + 1);
   return value;
 }
 
 void Ext_eepromWriteInt(int address, int value)
 {
   ExternalEeprom_write(address, (value >> 8) & 0xFF );
   ExternalEeprom_write(address + 1, value & 0xFF);
 }
#endif

Regards

That's perfect, works fine now.

many thanks Andy
Reply




Users browsing this thread: 1 Guest(s)