mirror of
https://github.com/buildwithparallel/mm-iot-sdk
synced 2026-08-10 21:27:58 -04:00
This commit introduces version 2.9.7 of the Morse Micro MM-IoT-SDK for ARM microcontroller base platforms.
257 lines
41 KiB
HTML
257 lines
41 KiB
HTML
<!-- HTML header for doxygen 1.8.17-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Morse Micro IoT SDK: porting_assistant.c Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="style.css" rel="stylesheet" type="text/css"/>
|
|
<link rel="shortcut icon" href="favicon.svg" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Morse Micro IoT SDK
|
|
 <span id="projectnumber">2.9.7</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.4 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('porting__assistant_8c_source.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">porting_assistant.c</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="porting__assistant_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * Copyright 2021-2023 Morse Micro</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> *</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * SPDX-License-Identifier: Apache-2.0</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> */</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include "porting_assistant.h"</span></div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#if defined(ENABLE_EXT_XTAL_INIT) && ENABLE_EXT_XTAL_INIT</span></div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment">/* The crystal initialization requires chip specific configuration which we do not have access</span></div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment"> * to in the porting assistant example application. */</span></div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#error "With ENABLE_EXT_XTAL_INIT defined this device is not supported by porting assistant."</span></div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">/* Test step declarations */</span></div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a181a7c6430a53be5b3f7720b76d8d837">test_step_os_malloc</a>; </div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a43251a7871e9d9ec98ccfc3457a8fd83">test_step_os_realloc</a>; </div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a93c9264e18588dbaa6428bf4f8e5724c">test_step_os_time</a>; </div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#ad3bcc858a9a91b6debf8c9ac4e154eae">test_step_os_task_creation</a>; </div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#ae7e4e54271f9f691de54d84661d7dbd4">test_step_mmhal_wlan_init</a>; </div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#aa5ba534559ea01f2b5d522508189e15e">test_step_mmhal_wlan_hard_reset</a>; </div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a4eb970665d2c5381c353e3cd7649346e">test_step_mmhal_wlan_sdio_startup</a>; </div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a0f64a18752e6bbe2bd95aa9b3d5a3f1a">test_step_read_chip_id</a>; </div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a75e008674a87e3eb2fb3d227d982ffb0">test_step_bulk_write_read</a>; </div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a626d84bb86f7056f3036d17c9c36a361">test_step_raw_tput</a>; </div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a6e77f8a79750cee36f9a25a9428edaaf">test_step_mmhal_wlan_validate_fw</a>; </div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a0cd1d3f133e8b404c6fff2558775a1e1">test_step_mmhal_wlan_validate_bcf</a>; </div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> <a class="code hl_variable" href="porting__assistant_8c.html#a3acb34d8e879ccc4a3bbde3bbc5c6eb4">test_step_verify_busy_pin</a>; </div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427"> 55</a></span><span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> * <span class="keyword">const</span> <a class="code hl_variable" href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427">test_steps</a>[] = {</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a181a7c6430a53be5b3f7720b76d8d837">test_step_os_malloc</a>,</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a43251a7871e9d9ec98ccfc3457a8fd83">test_step_os_realloc</a>,</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a93c9264e18588dbaa6428bf4f8e5724c">test_step_os_time</a>,</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> &<a class="code hl_variable" href="porting__assistant_8c.html#ad3bcc858a9a91b6debf8c9ac4e154eae">test_step_os_task_creation</a>,</div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> &<a class="code hl_variable" href="porting__assistant_8c.html#ae7e4e54271f9f691de54d84661d7dbd4">test_step_mmhal_wlan_init</a>,</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> &<a class="code hl_variable" href="porting__assistant_8c.html#aa5ba534559ea01f2b5d522508189e15e">test_step_mmhal_wlan_hard_reset</a>,</div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a4eb970665d2c5381c353e3cd7649346e">test_step_mmhal_wlan_sdio_startup</a>,</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a0f64a18752e6bbe2bd95aa9b3d5a3f1a">test_step_read_chip_id</a>,</div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a3acb34d8e879ccc4a3bbde3bbc5c6eb4">test_step_verify_busy_pin</a>,</div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a75e008674a87e3eb2fb3d227d982ffb0">test_step_bulk_write_read</a>,</div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a626d84bb86f7056f3036d17c9c36a361">test_step_raw_tput</a>,</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a6e77f8a79750cee36f9a25a9428edaaf">test_step_mmhal_wlan_validate_fw</a>,</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> &<a class="code hl_variable" href="porting__assistant_8c.html#a0cd1d3f133e8b404c6fff2558775a1e1">test_step_mmhal_wlan_validate_bcf</a>,</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span>};</div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="structtest__counters.html"> 72</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structtest__counters.html">test_counters</a></div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span>{</div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9"> 75</a></span> <span class="keywordtype">unsigned</span> <a class="code hl_variable" href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9">no_result</a>;</div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486"> 77</a></span> <span class="keywordtype">unsigned</span> <a class="code hl_variable" href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486">pass</a>;</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57"> 79</a></span> <span class="keywordtype">unsigned</span> <a class="code hl_variable" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">fail</a>;</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>};</div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="porting__assistant_8c.html#aedcb0efe71b17040326527ecc5b2a835"> 89</a></span><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code hl_function" href="porting__assistant_8c.html#aedcb0efe71b17040326527ecc5b2a835">result_code_to_string</a>(<span class="keyword">enum</span> test_result result)</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>{</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">switch</span> (result)</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> {</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">case</span> TEST_NO_RESULT: <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">case</span> TEST_PASSED: <span class="keywordflow">return</span> F_GREEN(<span class="stringliteral">"PASS"</span>);</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">case</span> TEST_SKIPPED: <span class="keywordflow">return</span> F_BLUE(<span class="stringliteral">"SKIP"</span>);</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">case</span> TEST_FAILED: <span class="keywordflow">return</span> F_RED(<span class="stringliteral">"FAIL"</span>);</div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">case</span> TEST_FAILED_NON_CRITICAL: <span class="keywordflow">return</span> F_YELLOW(<span class="stringliteral">"FAIL"</span>);</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_define" href="group__MMOSAL__ASSERT.html#ga9bae87b1059a31f390403d647b73e4b9">MMOSAL_ASSERT</a>(<span class="keyword">false</span>);</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}</div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="porting__assistant_8c.html#ac7c23a3495071e5795d7720887167666"> 110</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="porting__assistant_8c.html#ac7c23a3495071e5795d7720887167666">run_test_steps</a>(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code hl_struct" href="structtest__step.html">test_step</a> * <span class="keyword">const</span> steps[], <span class="keywordtype">size_t</span> num_steps,</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">struct</span> <a class="code hl_struct" href="structtest__counters.html">test_counters</a> *ctrs)</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>{</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">static</span> <span class="keywordtype">char</span> log_buf[1024];</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">size_t</span> ii;</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">for</span> (ii = 0; ii < num_steps; ii++)</div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> {</div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__step.html">test_step</a> *step = steps[ii];</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">size_t</span> log_buf_len = <span class="keyword">sizeof</span>(log_buf);</div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> log_buf[0] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> LOG_PRINTF(F_BOLD(<span class="stringliteral">"%-60s "</span>), step-><a class="code hl_variable" href="structtest__step.html#a21d3302d4f486af17e853c850bfda6b1">description</a>);</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> LOG_FLUSH();</div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">enum</span> test_result result = step-><a class="code hl_variable" href="structtest__step.html#acb667d4fea15f625b5946f707ecf875f">exec</a>(log_buf, log_buf_len);</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (result != TEST_NO_RESULT)</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> {</div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> LOG_PRINTF(<span class="stringliteral">"[ %s ]"</span>, <a class="code hl_function" href="porting__assistant_8c.html#aedcb0efe71b17040326527ecc5b2a835">result_code_to_string</a>(result));</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> }</div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> LOG_WRITE(<span class="stringliteral">"\n"</span>);</div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (log_buf[0] != <span class="charliteral">'\0'</span>)</div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> {</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> LOG_WRITE(<span class="stringliteral">"\n"</span>);</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> LOG_WRITE(log_buf);</div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> }</div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">switch</span> (result)</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> {</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">case</span> TEST_NO_RESULT: ctrs-><a class="code hl_variable" href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9">no_result</a>++; <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">case</span> TEST_PASSED: ctrs-><a class="code hl_variable" href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486">pass</a>++; <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">case</span> TEST_SKIPPED: <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">case</span> TEST_FAILED: ctrs-><a class="code hl_variable" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">fail</a>++; <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">case</span> TEST_FAILED_NON_CRITICAL: ctrs-><a class="code hl_variable" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">fail</a>++; <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> }</div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">if</span> (result == TEST_FAILED)</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> {</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span>}</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"><a class="line" href="porting__assistant_8c.html#add3190cf715f513666f4be42874d91e2"> 158</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="porting__assistant_8c.html#add3190cf715f513666f4be42874d91e2">app_init</a>(<span class="keywordtype">void</span>)</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span>{</div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="comment">/* Having deep sleep enabled can complicate debugging. Given the purpose of this applications</span></div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="comment"> * is to validate that you can communicate to the MM-Chip it will be disabled by default. */</span></div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <a class="code hl_function" href="group__MMHAL.html#ga3e8f1b40b2a974a117bbb7fb51682633">mmhal_set_deep_sleep_veto</a>(<a class="code hl_enumvalue" href="group__MMHAL.html#ggaac79b1527fe06a43a80df65ca4b39e94af1ac39d44848259e25b2fab02d03ea27">MMHAL_VETO_ID_APP_MIN</a>);</div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> </div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">struct </span><a class="code hl_struct" href="structtest__counters.html">test_counters</a> ctrs = { 0 };</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordtype">unsigned</span> num_tests = <span class="keyword">sizeof</span>(<a class="code hl_variable" href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427">test_steps</a>)/<span class="keyword">sizeof</span>(<a class="code hl_variable" href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427">test_steps</a>[0]);</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> LOG_WRITE(F_BOLD(<span class="stringliteral">"\n\nMM-IoT-SDK Porting Assistant\n"</span>));</div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> LOG_WRITE(<span class="stringliteral">"----------------------------\n\n"</span>);</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_function" href="porting__assistant_8c.html#ac7c23a3495071e5795d7720887167666">run_test_steps</a>(<a class="code hl_variable" href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427">test_steps</a>, num_tests, &ctrs);</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> LOG_PRINTF(<span class="stringliteral">"\n\n%u total test steps. %u passed, %u failed, %u no result, %u skipped\n"</span>,</div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> num_tests, ctrs.<a class="code hl_variable" href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486">pass</a>, ctrs.<a class="code hl_variable" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">fail</a>, ctrs.<a class="code hl_variable" href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9">no_result</a>,</div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> num_tests - ctrs.<a class="code hl_variable" href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9">no_result</a> - ctrs.<a class="code hl_variable" href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486">pass</a> - ctrs.<a class="code hl_variable" href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">fail</a>);</div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>}</div>
|
|
<div class="ttc" id="agroup__MMHAL_html_ga3e8f1b40b2a974a117bbb7fb51682633"><div class="ttname"><a href="group__MMHAL.html#ga3e8f1b40b2a974a117bbb7fb51682633">mmhal_set_deep_sleep_veto</a></div><div class="ttdeci">void mmhal_set_deep_sleep_veto(uint8_t veto_id)</div><div class="ttdoc">Sets a deep sleep veto that will prevent the device from entering deep sleep.</div></div>
|
|
<div class="ttc" id="agroup__MMHAL_html_ggaac79b1527fe06a43a80df65ca4b39e94af1ac39d44848259e25b2fab02d03ea27"><div class="ttname"><a href="group__MMHAL.html#ggaac79b1527fe06a43a80df65ca4b39e94af1ac39d44848259e25b2fab02d03ea27">MMHAL_VETO_ID_APP_MIN</a></div><div class="ttdeci">@ MMHAL_VETO_ID_APP_MIN</div><div class="ttdoc">Start of deep sleep veto ID range that is available for application use.</div><div class="ttdef"><b>Definition:</b> <a href="mmhal_8h_source.html#l00300">mmhal.h:300</a></div></div>
|
|
<div class="ttc" id="agroup__MMOSAL__ASSERT_html_ga9bae87b1059a31f390403d647b73e4b9"><div class="ttname"><a href="group__MMOSAL__ASSERT.html#ga9bae87b1059a31f390403d647b73e4b9">MMOSAL_ASSERT</a></div><div class="ttdeci">#define MMOSAL_ASSERT(expr)</div><div class="ttdoc">Assert that the given expression evaluates to true and abort execution if not.</div><div class="ttdef"><b>Definition:</b> <a href="mmosal_8h_source.html#l00927">mmosal.h:927</a></div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a0cd1d3f133e8b404c6fff2558775a1e1"><div class="ttname"><a href="porting__assistant_8c.html#a0cd1d3f133e8b404c6fff2558775a1e1">test_step_mmhal_wlan_validate_bcf</a></div><div class="ttdeci">const struct test_step test_step_mmhal_wlan_validate_bcf</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a0f64a18752e6bbe2bd95aa9b3d5a3f1a"><div class="ttname"><a href="porting__assistant_8c.html#a0f64a18752e6bbe2bd95aa9b3d5a3f1a">test_step_read_chip_id</a></div><div class="ttdeci">const struct test_step test_step_read_chip_id</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a181a7c6430a53be5b3f7720b76d8d837"><div class="ttname"><a href="porting__assistant_8c.html#a181a7c6430a53be5b3f7720b76d8d837">test_step_os_malloc</a></div><div class="ttdeci">const struct test_step test_step_os_malloc</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a3acb34d8e879ccc4a3bbde3bbc5c6eb4"><div class="ttname"><a href="porting__assistant_8c.html#a3acb34d8e879ccc4a3bbde3bbc5c6eb4">test_step_verify_busy_pin</a></div><div class="ttdeci">const struct test_step test_step_verify_busy_pin</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a43251a7871e9d9ec98ccfc3457a8fd83"><div class="ttname"><a href="porting__assistant_8c.html#a43251a7871e9d9ec98ccfc3457a8fd83">test_step_os_realloc</a></div><div class="ttdeci">const struct test_step test_step_os_realloc</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a4eb970665d2c5381c353e3cd7649346e"><div class="ttname"><a href="porting__assistant_8c.html#a4eb970665d2c5381c353e3cd7649346e">test_step_mmhal_wlan_sdio_startup</a></div><div class="ttdeci">const struct test_step test_step_mmhal_wlan_sdio_startup</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a626d84bb86f7056f3036d17c9c36a361"><div class="ttname"><a href="porting__assistant_8c.html#a626d84bb86f7056f3036d17c9c36a361">test_step_raw_tput</a></div><div class="ttdeci">const struct test_step test_step_raw_tput</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a6e77f8a79750cee36f9a25a9428edaaf"><div class="ttname"><a href="porting__assistant_8c.html#a6e77f8a79750cee36f9a25a9428edaaf">test_step_mmhal_wlan_validate_fw</a></div><div class="ttdeci">const struct test_step test_step_mmhal_wlan_validate_fw</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a75e008674a87e3eb2fb3d227d982ffb0"><div class="ttname"><a href="porting__assistant_8c.html#a75e008674a87e3eb2fb3d227d982ffb0">test_step_bulk_write_read</a></div><div class="ttdeci">const struct test_step test_step_bulk_write_read</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_a93c9264e18588dbaa6428bf4f8e5724c"><div class="ttname"><a href="porting__assistant_8c.html#a93c9264e18588dbaa6428bf4f8e5724c">test_step_os_time</a></div><div class="ttdeci">const struct test_step test_step_os_time</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_aa5ba534559ea01f2b5d522508189e15e"><div class="ttname"><a href="porting__assistant_8c.html#aa5ba534559ea01f2b5d522508189e15e">test_step_mmhal_wlan_hard_reset</a></div><div class="ttdeci">const struct test_step test_step_mmhal_wlan_hard_reset</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_ac7c23a3495071e5795d7720887167666"><div class="ttname"><a href="porting__assistant_8c.html#ac7c23a3495071e5795d7720887167666">run_test_steps</a></div><div class="ttdeci">static void run_test_steps(const struct test_step *const steps[], size_t num_steps, struct test_counters *ctrs)</div><div class="ttdoc">Iterate through the given list of test steps and execute until complete or until a critical failure o...</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00110">porting_assistant.c:110</a></div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_ad3bcc858a9a91b6debf8c9ac4e154eae"><div class="ttname"><a href="porting__assistant_8c.html#ad3bcc858a9a91b6debf8c9ac4e154eae">test_step_os_task_creation</a></div><div class="ttdeci">const struct test_step test_step_os_task_creation</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_add3190cf715f513666f4be42874d91e2"><div class="ttname"><a href="porting__assistant_8c.html#add3190cf715f513666f4be42874d91e2">app_init</a></div><div class="ttdeci">void app_init(void)</div><div class="ttdoc">Main entry point to the application.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00158">porting_assistant.c:158</a></div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_ade4a2de3bfac2a9bd304269c9ade4427"><div class="ttname"><a href="porting__assistant_8c.html#ade4a2de3bfac2a9bd304269c9ade4427">test_steps</a></div><div class="ttdeci">static const struct test_step *const test_steps[]</div><div class="ttdoc">Array of test steps.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00055">porting_assistant.c:55</a></div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_ae7e4e54271f9f691de54d84661d7dbd4"><div class="ttname"><a href="porting__assistant_8c.html#ae7e4e54271f9f691de54d84661d7dbd4">test_step_mmhal_wlan_init</a></div><div class="ttdeci">const struct test_step test_step_mmhal_wlan_init</div><div class="ttdoc">Test definition.</div></div>
|
|
<div class="ttc" id="aporting__assistant_8c_html_aedcb0efe71b17040326527ecc5b2a835"><div class="ttname"><a href="porting__assistant_8c.html#aedcb0efe71b17040326527ecc5b2a835">result_code_to_string</a></div><div class="ttdeci">static const char * result_code_to_string(enum test_result result)</div><div class="ttdoc">Convert a test_result code to string.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00089">porting_assistant.c:89</a></div></div>
|
|
<div class="ttc" id="astructtest__counters_html"><div class="ttname"><a href="structtest__counters.html">test_counters</a></div><div class="ttdoc">Counters to track test runs.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00072">porting_assistant.c:73</a></div></div>
|
|
<div class="ttc" id="astructtest__counters_html_a188c3153c12bb79ec48928c3ef2e48d9"><div class="ttname"><a href="structtest__counters.html#a188c3153c12bb79ec48928c3ef2e48d9">test_counters::no_result</a></div><div class="ttdeci">unsigned no_result</div><div class="ttdoc">Number of tests that did not return a pass/fail result.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00075">porting_assistant.c:75</a></div></div>
|
|
<div class="ttc" id="astructtest__counters_html_a5965b3bec605259b8401b077bdf94486"><div class="ttname"><a href="structtest__counters.html#a5965b3bec605259b8401b077bdf94486">test_counters::pass</a></div><div class="ttdeci">unsigned pass</div><div class="ttdoc">Number of tests that passed.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00077">porting_assistant.c:77</a></div></div>
|
|
<div class="ttc" id="astructtest__counters_html_af5f2189a3e269ccc18a998f0a710fb57"><div class="ttname"><a href="structtest__counters.html#af5f2189a3e269ccc18a998f0a710fb57">test_counters::fail</a></div><div class="ttdeci">unsigned fail</div><div class="ttdoc">Number of tests that failed.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8c_source.html#l00079">porting_assistant.c:79</a></div></div>
|
|
<div class="ttc" id="astructtest__step_html"><div class="ttname"><a href="structtest__step.html">test_step</a></div><div class="ttdoc">Test step descriptor.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8h_source.html#l00031">porting_assistant.h:32</a></div></div>
|
|
<div class="ttc" id="astructtest__step_html_a21d3302d4f486af17e853c850bfda6b1"><div class="ttname"><a href="structtest__step.html#a21d3302d4f486af17e853c850bfda6b1">test_step::description</a></div><div class="ttdeci">const char * description</div><div class="ttdoc">Short, user friendly description of the test step.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8h_source.html#l00034">porting_assistant.h:34</a></div></div>
|
|
<div class="ttc" id="astructtest__step_html_acb667d4fea15f625b5946f707ecf875f"><div class="ttname"><a href="structtest__step.html#acb667d4fea15f625b5946f707ecf875f">test_step::exec</a></div><div class="ttdeci">enum test_result(* exec)(char *log_buf, size_t log_buf_len)</div><div class="ttdoc">Test step execution function.</div><div class="ttdef"><b>Definition:</b> <a href="porting__assistant_8h_source.html#l00034">porting_assistant.h:36</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.17-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_91b8f418cff946e8d8b598a9068417a8.html">examples</a></li><li class="navelem"><a class="el" href="dir_7de8b8c8b2ab5cd087fb005fc8243698.html">porting_assistant</a></li><li class="navelem"><a class="el" href="dir_79a7522752d9b58767ff1718f87ed209.html">src</a></li><li class="navelem"><a class="el" href="porting__assistant_8c.html">porting_assistant.c</a></li>
|
|
<li class="footer">Copyright 2021 Morse Micro </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|