libhal / SJSU-Dev2

Firmware platform written by San Jose State University for building application for embedded systems
Apache License 2.0
42 stars 63 forks source link

project_config.hpp not respected #1309

Closed kammce closed 4 years ago

kammce commented 4 years ago

Describe the bug

Changing log levels in project_config.hpp does nothing.

To Reproduce

  1. Create a project and LogInfo() and LogDebug()
  2. Swap between the following list
    1. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_NONESET

    2. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_DEBUG

    3. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_INFO

  3. Notice that none of them change which logs get output

Expected behavior

  1. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_NONESET: should show no logs

  2. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_DEBUG: should show just debug logs

  3. define SJ2_LOG_LEVEL SJ2_LOG_LEVEL_INFO: should show debug and info logs

kammce commented 4 years ago

The constexpr if logic for logs is flipped Needs to be >= rather than <=

kammce commented 4 years ago

The default include directories are not correct and are undefined variables. Maybe we need to set something that breaks the makefile if undefined variables are used.

kammce commented 4 years ago

This seems to be a way to force make to quit if variables are used before they are created.

https://unix.stackexchange.com/questions/228331/avoid-running-the-script-if-a-variable-is-not-defined