//-----------------------------------------------------------------------------
///
/// \brief  Exception function
///
///         ...
///
/// \date   20181017
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


//---Documentation-------------------------------------------------------------


//---Includes------------------------------------------------------------------

#if defined(USE_FULL_ASSERT)

#include <stdint.h>

#endif

//---Own------------------------------

#include <biwak/exception.h>


//---Implementation------------------------------------------------------------


/// \brief  Giving the possibility to "throw" an exception
///
///         In fact nothing happens.
///         Libraries may link functions here to actually print the error
///         message.
void exception()
{
   while(1)
   {
      /// just hanging around, im dead...
   }
}

/*

void exception(const char* message)
{
   while(1)
   {
      /// just hanging around, im dead...
   }
}

void exception(const char* message, int status)
{
   while(1)
   {
      /// just hanging around, im dead...
   }
}

*/

#if defined(USE_FULL_ASSERT)

#include <stdint.h>

extern "C" {

void assert_failed(uint8_t* file, uint32_t line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}

}
#endif


//---fin-----------------------------------------------------------------------
