JAJAA48 October 2025 TDA4VM
次の関数は、MMA エラー注入テストのシーケンスがあることを検証します。次のコードは、エンド実装がユーザーによって完全に依存しているサンプルです。
volatile unit8_t track_exception = 0;
void test_fun(void)
{
switch(track_exception) /*track exception is a global variable , initialized to zero*/
{
case 0:
clear_mma(); /*this cleares the previous mma error code, definition is given above*/
track_exception = track_exception+1;//increment track //exception
overflow_exception();//generate exception
break;
case 1:
clear_mma();
track_exception = track_exception+1;
appLogPrintf("Under flow exception\n"); /*Only for debug, remove*/
underflow_exception(); // generate exception
break;
case 2:
clear_mma();
track_exception = track_exception+1;
appLogPrintf("offset parity exception\n"); /*only for debug remove*/
offset_parity_test();//generate excpetion
break;
case 3:
clear_mma();
appLogPrintf("config parity exception\n"); /*Only for debug*/
track_exception = track_exception+1;
config_parity_test();
break;
case 4:
clear_mma();
track_exception = track_exception+1;
appLogPrintf("offset parity exception\n");/*Only for debug*/
offset_parity_test();
break;
case 5:
appLogPrintf("Signal ESM\n");
appLogPrintf("Waiting for ESM event\n");
while(1) /*it needs to wait, if not the program doesnt go , and it would generate multiple exceptions*/
{
}
break;
default:
//Handle any unlikely scenario
break;
}
return;
}