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

Port to Nuttx #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
432 changes: 432 additions & 0 deletions ports/nuttx/include/flash_map_backend.h

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions ports/nuttx/include/memfault_platform_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#pragma once

//! @file memfault_platform_config.h
//!
//! Copyright 2022 Memfault, Inc
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! you may not use this file except in compliance with the License.
//! You may obtain a copy of the License at
//!
//! http://www.apache.org/licenses/LICENSE-2.0
//!
//! Unless required by applicable law or agreed to in writing, software
//! distributed under the License is distributed on an "AS IS" BASIS,
//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//! See the License for the specific language governing permissions and
//! limitations under the License.
//!
//! @brief
//! Platform overrides for the default configuration settings in the memfault-firmware-sdk.
//! Default configuration settings can be found in "memfault/config.h"

/*****************************************************************************
* Included Files
*****************************************************************************/

/****************************************************************************
* Preprocessor Definitions
****************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

// For example, decide if you want to use the Gnu Build ID.
// #define MEMFAULT_USE_GNU_BUILD_ID 1

#define MEMFAULT_PLATFORM_HAS_LOG_CONFIG 1

#define MEMFAULT_METRICS_HEARTBEAT_INTERVAL_SECS 600

#define MEMFAULT_PLATFORM_COREDUMP_STORAGE_USE_FLASH 1

#ifdef __cplusplus
}
#endif


/****************************************************************************
* Private Types
****************************************************************************/

/****************************************************************************
* Private Data
****************************************************************************/

/****************************************************************************
* Private Functions
****************************************************************************/

/****************************************************************************
* Public Functions
****************************************************************************/
63 changes: 63 additions & 0 deletions ports/nuttx/include/memfault_platform_log_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//! @file
//!
//! Copyright 2022 Memfault, Inc
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! you may not use this file except in compliance with the License.
//! You may obtain a copy of the License at
//!
//! http://www.apache.org/licenses/LICENSE-2.0
//!
//! Unless required by applicable law or agreed to in writing, software
//! distributed under the License is distributed on an "AS IS" BASIS,
//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//! See the License for the specific language governing permissions and
//! limitations under the License.
//!
//! @brief
//! Logging depends on how your configuration does logging. See
//! https://docs.memfault.com/docs/mcu/self-serve/#logging-dependency


/*****************************************************************************
* Included Files
*****************************************************************************/

#include <syslog.h>

/****************************************************************************
* Preprocessor Definitions
****************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#define MEMFAULT_LOG_DEBUG(fmt, ...) syslog(LOG_DEBUG, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
#define MEMFAULT_LOG_INFO(fmt, ...) syslog(LOG_INFO, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
#define MEMFAULT_LOG_WARN(fmt, ...) syslog(LOG_WARNING, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
#define MEMFAULT_LOG_ERROR(fmt, ...) syslog(LOG_ERR, "%s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)

#ifdef __cplusplus
}
#endif

/****************************************************************************
* Preprocessor Definitions
****************************************************************************/

/****************************************************************************
* Private Types
****************************************************************************/

/****************************************************************************
* Private Data
****************************************************************************/

/****************************************************************************
* Private Functions
****************************************************************************/

/****************************************************************************
* Public Functions
****************************************************************************/
Loading