<h3>Contribution description</h3>
<ul>
<li>Changed declaration of SAUL classes (while keeping the format)
<ul>
<li>Termed "class of SAUL classes" category of SAUL classes in the doc to avoid confusion. (E.g. a SAUL class will now be in category sensor or  actuator.)</li>
<li>Separate enums for SAUL category and intra-category ID. Numbers will now but auto-assigned by the compiler</li>
</ul>
</li>
<li>Use constant look-up tables for stringification (one table per SAUL category).<br>
==> This saves 512B in .data section of AVR</li>
</ul>
<p>TL;DR:</p>
<p>Pro:</p>
<ul>
<li>Smaller RAM footprint</li>
<li>No manual management of class numbers</li>
</ul>
<p>Cons:</p>
<ul>
<li>Adding new classes requires changing 2 lines instead of 1 (or 3 lines instead of 2 when counting stringification)</li>
</ul>
<h3>Testing procedure</h3>
<p><code>examples/saul</code> should still work with your favorite board</p>
<h3>Issues/PRs references</h3>
<p>Split off from <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="433194532" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11392" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11392/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11392">#11392</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/11394'>https://github.com/RIOT-OS/RIOT/pull/11394</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>drivers/saul: Improved stringification</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11394/files#diff-0">drivers/include/saul.h</a>
    (156)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11394/files#diff-1">drivers/saul/saul_str.c</a>
    (106)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11394.patch'>https://github.com/RIOT-OS/RIOT/pull/11394.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11394.diff'>https://github.com/RIOT-OS/RIOT/pull/11394.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11394">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YDiTuf2dhgHgcZaB7HTYsXD_fuJWks5vhFPZgaJpZM4cvok9">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YPCBptGX7YE52urU_E1Fxxofh9EMks5vhFPZgaJpZM4cvok9.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"drivers/saul: Improved stringification (#11394)"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/11394"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11394",
"url": "https://github.com/RIOT-OS/RIOT/pull/11394",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>