Add generic function to print deprecation notes (#1538)

This commit is contained in:
Marcel Stör 2017-03-01 12:42:20 +01:00 committed by GitHub
parent f577c2c080
commit a26969b388
2 changed files with 8 additions and 0 deletions

View File

@ -916,3 +916,8 @@ uint32_t platform_flash_mapped2phys (uint32_t mapped_addr)
uint32_t meg = (b1 << 1) | b0;
return mapped_addr - INTERNAL_FLASH_MAPPED_ADDRESS + meg * 0x100000;
}
void* platform_print_deprecation_note( const char *msg, const char *time_frame)
{
c_printf( "Warning, deprecated API! %s. It will be removed %s. See documentation for details.\n", msg, time_frame );
}

View File

@ -302,6 +302,9 @@ int platform_gpio_exists( unsigned id );
int platform_tmr_exists( unsigned id );
// *****************************************************************************
void* platform_print_deprecation_note( const char *msg, const char *time_frame);
// Helper macros
#define MOD_CHECK_ID( mod, id )\
if( !platform_ ## mod ## _exists( id ) )\