Projekt

Allgemein

Profil

Feature #367

Von Maximilian Seesslen vor fast 2 Jahren aktualisiert

Biwak classes should be able to indicate errors in debug mode
that may be handled in application layer later.

<pre><code class="cpp">
lDebugAssert( sta == 2, "Could not write (%d)", sta);
</code></pre>

* remove lAssertSta(); it can be done in an single macro, see below.
* implement pretty-print, see below.
* Only use lLog and lLogImpl; others are macros
* Implement lLogImpl in biwak
* Used macros: LEPTO_LOG_PRETTY_PRINT, FLASH_SIZE, LEPTO_LOG_PRETTY_PARAMS, \_\_FILENAME\_\_, Ansi-Codes, LEPTO_LOG_DEBUG, LEPTO_LOG_DEBUG_ASSERT
* Use different function names for pretty-print to force an linker error when configurations of compile units do not match
* adjust documentation


So lepto should also set \_\_FILENAME\_\_
<pre>
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
</pre>

Put the pretty logic into biwak cmake file in order not to put biwak logic into lepto:
<pre><code class="shell">
set ( MCU_FLASH_SIZE 32768 )

if( MCU_FLASH_SIZE GREATER_EQUAL 65536 )
add_definitions( -DLEPTO_LOG_PRETTY_PRINT)
endif( MCU_FLASH_SIZE GREATER_EQUAL 65536 )
</code></pre>

Zurück