Ejemplo n.º 1
0
/** @brief Process a critical file system error.

    @param pszFileName  The file in which the error occurred.
    @param ulLineNum    The line number at which the error occurred.
*/
void RedVolCriticalError(
    const char *pszFileName,
    uint32_t    ulLineNum)
{
  #if REDCONF_OUTPUT == 1
  #if REDCONF_READ_ONLY == 0
    if(!gpRedVolume->fReadOnly)
    {
        RedOsOutputString("Critical file system error in Reliance Edge, setting volume to READONLY\n");
    }
    else
  #endif
    {
        RedOsOutputString("Critical file system error in Reliance Edge (volume already READONLY)\n");
    }
  #endif

  #if REDCONF_READ_ONLY == 0
    gpRedVolume->fReadOnly = true;
  #endif

  #if REDCONF_ASSERTS == 1
    RedOsAssertFail(pszFileName, ulLineNum);
  #else
    (void)pszFileName;
    (void)ulLineNum;
  #endif
}
Ejemplo n.º 2
0
/** @brief Display the Reliance Edge signon message.
*/
void RedSignOn(void)
{
  #if REDCONF_OUTPUT == 1

    /*  Use RedOsOutputString() instead of RedPrintf() to avoid using variadic
        arguments, since this function is called from the driver and cannot use
        functions that violate MISRA-C:2012.
    */
    RedOsOutputString(RED_PRODUCT_NAME "\n");
    RedOsOutputString(RED_PRODUCT_EDITION "\n");
    RedOsOutputString(RED_PRODUCT_LEGAL "\n");
    RedOsOutputString(RED_PRODUCT_PATENT "\n");

  #else

    /*  Always embed the copyright into the program data.  Use "volatile" to try
        to avoid the compiler removing the variables.
    */
    static volatile const char szVersion[] = RED_PRODUCT_NAME;
    static volatile const char szEdition[] = RED_PRODUCT_EDITION;
    static volatile const char szCopyright[] = RED_PRODUCT_LEGAL;
    static volatile const char szPatent[] = RED_PRODUCT_PATENT;

    (void)szVersion;
    (void)szEdition;
    (void)szCopyright;
    (void)szPatent;

  #endif
}