Skip to content
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
2 changes: 1 addition & 1 deletion NetX/src/u_nx_ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void _receive_message(NX_UDP_SOCKET *socket) {

/* Process received message */
if(status == NX_SUCCESS) {
PRINTLN_INFO("Received ethernet message! (Sender ID: %d, Message ID: %d, bytes_copied: %d).", message.sender_id, message.message_id, bytes_copied);
PRINTLN_INFO("Received ethernet message! (Sender ID: %d, Message ID: %d, bytes_copied: %ld).", message.sender_id, message.message_id, bytes_copied);
device.on_recieve(message);
}
}
Expand Down
8 changes: 4 additions & 4 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ RUN ln -sf /usr/lib/linux-tools-*/* /usr/bin/

# Install cross compiler
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi.tar.xz | tar -xJv; \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-aarch64-arm-none-eabi.tar.xz | tar -xJv; \
else \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz | tar -xJv; \
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz | tar -xJv; \
fi

ENV PATH $PATH:/home/dev/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi/bin
ENV PATH $PATH:/home/dev/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin
ENV PATH $PATH:/home/dev/arm-gnu-toolchain-14.2.rel1-aarch64-arm-none-eabi/bin
ENV PATH $PATH:/home/dev/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin

# build and install customized openocd
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
Expand Down
4 changes: 2 additions & 2 deletions middleware/src/c_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unsigned char reverse_bits(unsigned char b)

float linear_interpolate(float x, float x1, float x2, float y1, float y2)
{
assert(fabs(x2 - x1) > FLOAT_EPSILON);
assert(fabsf(x2 - x1) > FLOAT_EPSILON);

return y1 + ((x - x1) * (y2 - y1) / (x2 - x1));
}
Expand All @@ -40,4 +40,4 @@ void uint16_to_uint8(uint16_t value, uint8_t arr[2])
{
arr[1] = (uint8_t)value;
arr[0] = (uint8_t)(value >> 8);
}
}
26 changes: 19 additions & 7 deletions threadX/inc/u_tx_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/* Gets the name of the file. */
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

/* DEBUG MESSAGE LEVELS */
/* DEBUG MESSAGE LEVELS */
/* These can be commented out to enable/disable printing of the associated debug messages. */
#define LOG_ERROR /* Messages indicating that something has definitely gone wrong. */
#define LOG_WARNING /* Messages indicating that something 'might' have gone wrong, but either isn't immidietely critical or is only a problem in certain contexts. */
Expand All @@ -35,21 +35,33 @@

/* PRINTLN_ERROR() */
#if defined(LOG_ERROR) && !defined(NO_LOG)
#define PRINTLN_ERROR(message, ...) printf("[%s/%s()] ERROR: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints an ERROR message in the format: "[file_name.c/function()] ERROR: {message}"*/
#define PRINTLN_ERROR(message, ...) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
printf("[%s/%s()] ERROR: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints an ERROR message in the format: "[file_name.c/function()] ERROR: {message}"*/
_Pragma("GCC diagnostic pop")
#else
#define PRINTLN_ERROR(message, ...) /* If debugging is turned off, macro doesn't need to expand to anything. */
#endif

/* PRINTLN_WARNING() */
#if defined(LOG_WARNING) && !defined(NO_LOG)
#define PRINTLN_WARNING(message, ...) printf("[%s/%s()] WARNING: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints a WARNING message in the format: "[file_name.c/function()] WARNING: {message}"*/
#define PRINTLN_WARNING(message, ...) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
printf("[%s/%s()] WARNING: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints a WARNING message in the format: "[file_name.c/function()] WARNING: {message}"*/
_Pragma("GCC diagnostic pop")
#else
#define PRINTLN_WARNING(message, ...) /* If debugging is turned off, macro doesn't need to expand to anything. */
#endif

/* PRINTLN_INFO() */
#if defined(LOG_INFO) && !defined(NO_LOG)
#define PRINTLN_INFO(message, ...) printf("[%s/%s()] INFO: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints an INFO message in the format: "[file_name.c/function()] INFO: {message}"*/
#define PRINTLN_INFO(message, ...) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
printf("[%s/%s()] INFO: " message "\n", __FILENAME__, __func__, ##__VA_ARGS__) /* Prints an INFO message in the format: "[file_name.c/function()] INFO: {message}"*/
_Pragma("GCC diagnostic pop")
#else
#define PRINTLN_INFO(message, ...) /* If debugging is turned off, macro doesn't need to expand to anything. */
#endif
Expand All @@ -58,8 +70,8 @@
* @brief Checks if a function is successful when called. Prints an error message if it fails.
* @param function_call The function to call.
* @param success The function's success code/macro (e.g., U_SUCCESS, TX_SUCCESS, etc.).
*
* @note This macro intentionally doesn't support custom error messages, for the sake of readability. If an error is complex enough to
*
* @note This macro intentionally doesn't support custom error messages, for the sake of readability. If an error is complex enough to
* require a custom message, the error should probably be checked manually and PRINTLN_ERROR() called directly.
*/
#define CATCH_ERROR(function_call, success) do { \
Expand All @@ -82,4 +94,4 @@ const char *hal_status_toString(HAL_StatusTypeDef status);

// clang-format on

#endif
#endif
Loading