Uploaded image for project: 'Zephyr'
  1. Zephyr
  2. ZEP-240

printk/printf usage in samples

    Details

    • Type: Story
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.6.0
    • Component/s: Samples
    • Labels:

      Description

      One of the most used code snippets in sample code is:

      #if defined(CONFIG_STDOUT_CONSOLE)
      #include <stdio.h>
      #define PRINT           printf
      #else
      #include <misc/printk.h>
      #define PRINT           printk
      #endif
      

      It is being copied over and over again and in some cases there is no need for printf or the sample does not configure CONFIG_STDOUT_CONSOLE at all, so basically there is no need for this check.

      Alternative is to provide this code snippet in a generic way and let the user just PRINT without having to repeat the code...

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              anasnashif Anas Nashif
              Reporter:
              anasnashif Anas Nashif
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: