cancel
Showing results for 
Search instead for 
Did you mean: 

Improvement in STSW-ST25RFAL 4.0 source

CanRF
Associate II

Hi

I Reported this for Improvement in STSW-ST25RFAL 3.0 source before.

Now STSW-ST25RFAL 4.0 is available but the following problems are not changed.

1) Add to rfal_analogConfig.h, rfal_crc.h, rfal_iso15693_2.h header files.

#if defined( __cplusplus )
extern "C" {
#endif

otherwise this file makes it difficult with C++

 

2) Add to rfal_analogConfig.h header files.

#if !defined( __cplusplus )
typedef struct {
  uint8_t id[sizeof(rfalAnalogConfigId)]; 
  rfalAnalogConfigNum num; 
  rfalAnalogConfigRegAddrMaskVal regSet[];

} rfalAnalogConfig;

#else

struct rfalAnalogConfig;

#endif

C++ can't handle an empty array regSet[] in a struct

 

1 REPLY 1
Ulysses HERNIOSUS
ST Employee

Hi CanRF,

actually we have not concluded that it really is a good idea to spread these macros. IMO they don't hinder you from using the sources as you could 

  1. compile the RFAL using C++ compiler - using C++ name mangling - not needing any "extern "C""
  2. compile the RFAL using C-compiler and in your C++ compiled codes include all the RFAL sources using 
    extern "C" {
    #include "rfal_rf.h"
    }​

Spreading the proposed #defined(__cplusplus) would prevent the first use case.

BR, Ulysses