Skip to content

Version 1.6.0

Compare
Choose a tag to compare
@grodansparadis grodansparadis released this 23 Mar 14:45
· 128 commits to master since this release

The main difference in this release is that the segment controller check has been removed. This means that the node control that was present in register 131/0x83 is now replaced by the error counter. Thus read the current error counter value from this register. Reset the error counter by writing anything to the register.

With the same segment check removed a node that is moved from one segment to another now must be manually initialized after it has been started up.

Previously one control byte was used to check for initialized EEPROM. Now this is two bytes. The callbacks for this purpose has therefore been changed.

///////////////////////////////////////////////////////////////////////////////
// setVSCPControlByte
//
void vscp_setControlByte( uint8_t idx, uint8_t ctrl )
{
    if ( idx > 1 ) return;
    eeprom_write( VSCP_EEPROM_CONTROL1 + idx, ctrl );
}
///////////////////////////////////////////////////////////////////////////////
// getVSCPControlByte
//
uint8_t vscp_getControlByte( uint8_t idx )
{
    if ( idx > 1 ) return 0;
    return eeprom_read( VSCP_EEPROM_CONTROL1 + idx );
}

Another callback has been added that do the actual initialization of the EEPROM

///////////////////////////////////////////////////////////////////////////////
// vscp_init_pstorage
//
void vscp_init_pstorage( void )
{
    init_app_eeprom();
}

An addition is added if you define

VSCP_FIRMWARE_ENABLE_ERROR_REPORTING

which will give access to a method for VSCP standard error reporting

/*!
    Send error event (CLASS=508).
    http://www.vscp.org/docs/vscpspec/doku.php?id=class1.error
    idx can be used to identify the internal part ("submodule") that was the
    origin of the error. Both zone and sub zone are always set to zero.
    @param type This is the VSCP type
    @param idx Index to identify possible sub module. Normally set to zero.
    @return True if event was sent.
*/
#ifdef VSCP_FIRMWARE_ENABLE_ERROR_REPORTING
uint8_t vscp_sendErrorEvent( uint8_t type, uint8_t idx );
#endif

Just remember that over CAN it is no use in reporting communication problems as doing so will most likely make them worse.

Another addition is added if you define

VSCP_FIRMWARE_ENABLE_LOGGING

which gives access to a method for standard VSCP logging.

/*!
    Send log event (CLASS=509). 
    http://www.vscp.org/docs/vscpspec/doku.php?id=class1.log
    For loging first send Type = 2(0x01) Log Start then logging events and when 
    log is closed send Type = 3 (0x03) Log Stop. To log several things use a 
    unique if for each and open/close each.  
    @param type VSCP logevent type.
    @param id Identifier for the logging channel.
    @param level Loglevel for this log event.
    @param idx index for multiframe log event starting at zero.
    @param pData Log data (Allways 5 bytes).
    @return TRUE if event was sent.
 */
#ifdef VSCP_FIRMWARE_ENABLE_LOGGING
uint8_t vscp_sendLogEvent( uint8_t type, 
                            uint8_t id, 
                            uint8_t level, 
                            uint8_t idx, 
                            uint8_t data );
#endif

As always the Paris project and the Kelvin NTC10K project can be used as reference code.


Do you want to support this project?

Paradise of the Frog AB sell low cost open source/hardware that is VSCP enabled. There is a lot of useful modules
available and more is on the way. If you want to support this development the best thing you can do is to buy something
from the Frogshop, http://www.frogshop.se, or contribute code or report/fix bugs. There is also possible to
sponsor the project. More info is here http://www.vscp.org/wiki/doku.php/sponsors

Enjoy!

LOS, Sweden 2016-03-23
Ake Hedman
Paradise of the Frog AB