WeatherDuino Forum
WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - Printable Version

+- WeatherDuino Forum (https://www.meteocercal.info/forum)
+-- Forum: WeatherDuino Pro2 Weather Stations (https://www.meteocercal.info/forum/Forum-WeatherDuino-Pro2-Weather-Stations)
+--- Forum: Software Questions (https://www.meteocercal.info/forum/Forum-Software-Questions)
+--- Thread: WeatherDuino_P2AT328_RX_v4.0_b001 Compile error (/Thread-WeatherDuino-P2AT328-RX-v4-0-b001-Compile-error)



WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - atbukc - 17-02-2019

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


RE: WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - Werk_AG - 18-02-2019

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.


RE: WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - atbukc - 18-02-2019

(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..


RE: WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - Werk_AG - 21-02-2019

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


RE: WeatherDuino_P2AT328_RX_v4.0_b001 Compile error - atbukc - 21-02-2019

(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