Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log level enhancements #66

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/can/Kconfig.sccan
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2023 Space Cubics,LLC
# SPDX-License-Identifier: Apache-2.0

config CAN_SCCAN
menuconfig CAN_SCCAN
bool "Space Cubics CAN Driver"
default y
depends on DT_HAS_SC_CAN_ENABLED
Expand Down
6 changes: 5 additions & 1 deletion drivers/i2c/Kconfig.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
# Copyright (c) 2023 Space Cubics,LLC
# SPDX-License-Identifier: Apache-2.0

config I2C_SC
menuconfig I2C_SC
bool "Space Cubics I2C Master Driver"
default y
depends on DT_HAS_SC_I2C_ENABLED
help
Enable Space Cubics I2C Master Driver.

if I2C_SC

config I2C_SC_TRANSFER_TIMEOUT_MS
int "I2C Transfer timeout [ms]"
default 100
help
Timeout in milliseconds used for each I2C transfer.

endif
4 changes: 4 additions & 0 deletions drivers/misc/dstrx3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ config SC_DSTRX3_INIT_PRIORITY
help
DSTRX-3 Device driver initialization priority.

module = SC_DSTRX3
module-str = Space Cubics DSTRX-3 (S-Band Transceiver) driver
source "subsys/logging/Kconfig.template.log_config"

endif
2 changes: 1 addition & 1 deletion drivers/misc/dstrx3/sc_dstrx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define DT_DRV_COMPAT sc_dstrx3

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(sc_dstrx3, LOG_LEVEL_INF);
LOG_MODULE_REGISTER(sc_dstrx3, CONFIG_SC_DSTRX3_LOG_LEVEL);

#include <zephyr/irq.h>
#include <zephyr/sys/byteorder.h>
Expand Down
4 changes: 4 additions & 0 deletions drivers/misc/fpga/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ config SC_FPGASYS_INIT_PRIORITY
help
FPGA System Register driver initialization priority.

module = SC_FPGASYS
module-str = Space Cubics FPGA System Register driver
source "subsys/logging/Kconfig.template.log_config"

endif
2 changes: 1 addition & 1 deletion drivers/misc/fpga/sc_fpgasys.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "sc_fpgasys.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(sc_fpgasys, LOG_LEVEL_INF);
LOG_MODULE_REGISTER(sc_fpgasys, CONFIG_SC_FPGASYS_LOG_LEVEL);

#include <zephyr/kernel.h>
#include <zephyr/device.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/Kconfig.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2023 Space Cubics,LLC
# SPDX-License-Identifier: Apache-2.0

config PWM_SC
menuconfig PWM_SC
bool "Space Cubics PWM Driver"
default y
depends on DT_HAS_SC_PWM_ENABLED
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/Kconfig.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ menuconfig SPI_SC_QSPI
help
Enable Space Cubics QSPI driver.

if SPI_SC_QSPI

config SPI_SC_IDLE_TIMEOUT_MS
int "Timeout duration for waiting until the SPI Bus becomes idle.[ms]"
default 100
help
Timeout duration for waiting until the SPI Bus becomes idle. [ms]

endif
2 changes: 1 addition & 1 deletion drivers/spi/spi_sc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#define LOG_LEVEL CONFIG_SPI_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(spi_sc);
LOG_MODULE_REGISTER(spi_sc, CONFIG_SPI_LOG_LEVEL);

#include <zephyr/drivers/spi.h>
#include "spi_context.h"
Expand Down
4 changes: 4 additions & 0 deletions tests/hwtest/adcs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ config SCSAT1_ADCS_AUTO_RUN_HWTEST
help
Enable auto run for HW test.

module = SCSAT1_ADCS
module-str = SC-Sat1 ADCS Board
source "subsys/logging/Kconfig.template.log_config"

endmenu

menu "Zephyr"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/adcs_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "imu.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(adcs_init);
LOG_MODULE_REGISTER(adcs_init, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

int adcs_init(uint32_t *err_cnt)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/csp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "syshk.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(csp);
LOG_MODULE_REGISTER(csp, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define ROUTER_STACK_SIZE (256U)
#define SERVER_STACK_SIZE (1024U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/cv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "cv.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cv);
LOG_MODULE_REGISTER(cv, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define CV_ADCS_ADDR (0x42)
#define CV_RW_ADDR (0x40)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/cv_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "sysmon.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cv_test);
LOG_MODULE_REGISTER(cv_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define CV_INVALID_FLOAT (0.0f)
#define CV_INVALID_UINT (0U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "gnss.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(gnss);
LOG_MODULE_REGISTER(gnss, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define GNSS_WAKE_RETRY_COUNT (200U)
#define GNSS_HWMON_RETRY_COUNT (2000U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "imu.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(imu);
LOG_MODULE_REGISTER(imu, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define IMU_STD_DATA_SIZE (19U)
#define IMU_EXT_DATA_SIZE (26U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/imu_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "imu_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(imu_test);
LOG_MODULE_REGISTER(imu_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

static void imu_print_imu_data(struct imu_data *data)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/loop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "rw.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(loop_test);
LOG_MODULE_REGISTER(loop_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

struct k_event loop_event;

Expand Down
6 changes: 3 additions & 3 deletions tests/hwtest/adcs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <stdlib.h>
#include <zephyr/kernel.h>
#include <zephyr/shell/shell_uart.h>
#include <zephyr/logging/log.h>
#include "common.h"
#include "csp.h"
#include "wdog.h"
Expand All @@ -21,6 +20,9 @@
#include "loop_test.h"
#include "syshk_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(adcs_main, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define CMD_HANDLER_PRIO (0U)
#define CMD_EXEC_EVENT (1U)

Expand All @@ -31,8 +33,6 @@ static struct k_thread cmd_thread;
static struct k_event exec_event;
extern struct k_event loop_event;

LOG_MODULE_REGISTER(adcs_main);

static void cmd_handler(void *p1, void *p2, void *p3)
{
int ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "cv.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(rw);
LOG_MODULE_REGISTER(rw, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define SC_RWM_BASE_ADDR (0x50030000)
#define SC_RWM_MENR_OFFSET (0x0000)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/rw_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "rw_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(rw_test);
LOG_MODULE_REGISTER(rw_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

static void print_rw_status(enum rw_pos pos, uint32_t sec)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/syshk.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "syshk.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(syshk);
LOG_MODULE_REGISTER(syshk, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define CSP_TIMEOUT_MSEC (100U)
#define SYSHK_PORT (10U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/syshk_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "version.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(syshk_test);
LOG_MODULE_REGISTER(syshk_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

static uint8_t syshk_head = 0;
uint8_t syshk_tail = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/sysmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "version.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(sysmon);
LOG_MODULE_REGISTER(sysmon, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

/* Registers */
#define SC_ADCS_SYSREG_BASE_ADDR (0x4F000000) /* System Register */
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/temp.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "temp.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(temp);
LOG_MODULE_REGISTER(temp, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define ADCS_TEMP_REG (0x00)

Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/adcs/src/temp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "sysmon.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(temp_test);
LOG_MODULE_REGISTER(temp_test, CONFIG_SCSAT1_ADCS_LOG_LEVEL);

#define TEMP_INVLAID_FLOAT (0.0f)

Expand Down
4 changes: 4 additions & 0 deletions tests/hwtest/main/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ config SCSAT1_MAIN_CAP_INTERVAL_SEC
help
Interval (seconds) of capture frame command

module = SCSAT1_MAIN
module-str = SC-Sat1 Main Board
source "subsys/logging/Kconfig.template.log_config"

endmenu

menu "Zephyr"
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/csp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "csp.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(csp);
LOG_MODULE_REGISTER(csp, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define ROUTER_STACK_SIZE 256
#define SERVER_STACK_SIZE 1024
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/csp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "csp_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(csp_test);
LOG_MODULE_REGISTER(csp_test, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define CSP_TIMEOUT_MSEC (100U)
#define CSP_GET_TEMP_ZERO (11U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/cv.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "cv.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cv);
LOG_MODULE_REGISTER(cv, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define CV_ADDR (0x42)

Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/cv_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "cv_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cv_test);
LOG_MODULE_REGISTER(cv_test, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define CV_INVALID_FLOAT (0.0f)
#define CV_INVALID_UINT (0U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/dstrx3_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "dstrx3_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(dstrx3_test);
LOG_MODULE_REGISTER(dstrx3_test, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

static void dstrx3_print_hk(struct sc_dstrx3_hk *hk)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/loop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "mtq.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(loop_test);
LOG_MODULE_REGISTER(loop_test, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

struct k_event loop_event;
extern enum hwtest_mode test_mode;
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "syshk_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
LOG_MODULE_REGISTER(main, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define CMD_HANDLER_PRIO (0U)
#define CMD_EXEC_EVENT (1U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/main_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "sysmon.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main_init);
LOG_MODULE_REGISTER(main_init, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

enum hwtest_mode test_mode;

Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/mgnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "mgnm.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mgnm);
LOG_MODULE_REGISTER(mgnm, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define MGNM_SLAVE_ADDR (0x30)
#define MGNM_XOUTL_REG (0x00)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/mgnm_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "mgnm_test.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mgnm_test);
LOG_MODULE_REGISTER(mgnm_test, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

#define MGNM_INVALID_TEMP (0.0f)
#define MGNM_INVALID_DATA (0U)
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/mtq.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "mtq.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mtq);
LOG_MODULE_REGISTER(mtq, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

struct mtq_pwm_config {
uint8_t channel;
Expand Down
3 changes: 0 additions & 3 deletions tests/hwtest/main/src/mtq_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#include "mtq.h"
#include "mgnm.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mtq_test);

static int print_mgnm(uint32_t sec)
{
for (int i = 0; i < sec; i++) {
Expand Down
2 changes: 1 addition & 1 deletion tests/hwtest/main/src/scbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <zephyr/kernel.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(scbus);
LOG_MODULE_REGISTER(scbus, CONFIG_SCSAT1_MAIN_LOG_LEVEL);

/* Registers */
#define SC_MAIN_SCBUS_BASE_ADDR (0x40300000) /* SC Bus Control */
Expand Down
Loading