[core] Update Arduino compatibility, fix MD5 library
This commit is contained in:
@@ -9,3 +9,9 @@
|
|||||||
#undef ntohs
|
#undef ntohs
|
||||||
#undef htonl
|
#undef htonl
|
||||||
#undef ntohl
|
#undef ntohl
|
||||||
|
|
||||||
|
// fix conflicts with std::max() and std::min()
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#undef max
|
||||||
|
#undef min
|
||||||
|
#endif
|
||||||
|
|||||||
8
cores/beken-72xx/base/fixups/include.h
Normal file
8
cores/beken-72xx/base/fixups/include.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */
|
||||||
|
|
||||||
|
#include_next "include.h"
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// force including fixups/generic.h, even by BDK/include.h
|
||||||
|
#include "generic.h"
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if 0 // maybe simply using void* is easier? this is not C++ so it will link anyway
|
|
||||||
// available built-in implementations
|
// available built-in implementations
|
||||||
#if LT_ARD_MD5_POLARSSL
|
#if LT_ARD_MD5_POLARSSL
|
||||||
#include "MD5PolarSSLImpl.h"
|
#include "MD5PolarSSLImpl.h"
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
#if LT_ARD_MD5_HOSTAPD
|
#if LT_ARD_MD5_HOSTAPD
|
||||||
#include "MD5HostapdImpl.h"
|
#include "MD5HostapdImpl.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
// common API
|
// common API
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
struct MD5Context {
|
||||||
|
unsigned long buf[4];
|
||||||
|
unsigned long bits[2];
|
||||||
|
unsigned char in[64];
|
||||||
|
};
|
||||||
|
|
||||||
typedef uint32_t u32;
|
|
||||||
typedef uint8_t u8;
|
|
||||||
|
|
||||||
#include <crypto/md5_i.h>
|
|
||||||
#define LT_MD5_CTX_T struct MD5Context
|
#define LT_MD5_CTX_T struct MD5Context
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -6,7 +6,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <mbedtls/md5.h>
|
typedef struct {
|
||||||
|
unsigned long total[2]; /*!< number of bytes processed */
|
||||||
|
unsigned long state[4]; /*!< intermediate digest state */
|
||||||
|
unsigned char buffer[64]; /*!< data block being processed */
|
||||||
|
} mbedtls_md5_context;
|
||||||
|
|
||||||
#define LT_MD5_CTX_T mbedtls_md5_context
|
#define LT_MD5_CTX_T mbedtls_md5_context
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -6,7 +6,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <polarssl/md5.h>
|
typedef struct {
|
||||||
|
unsigned long total[2]; /*!< number of bytes processed */
|
||||||
|
unsigned long state[4]; /*!< intermediate digest state */
|
||||||
|
unsigned char buffer[64]; /*!< data block being processed */
|
||||||
|
} md5_context;
|
||||||
|
|
||||||
#define LT_MD5_CTX_T md5_context
|
#define LT_MD5_CTX_T md5_context
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ using std::min;
|
|||||||
|
|
||||||
// FreeRTOS kernel
|
// FreeRTOS kernel
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
|
#include <task.h>
|
||||||
|
|
||||||
// Define available serial ports
|
// Define available serial ports
|
||||||
#if defined(__cplusplus) && LT_ARD_HAS_SERIAL
|
#if defined(__cplusplus) && LT_ARD_HAS_SERIAL
|
||||||
|
|||||||
Reference in New Issue
Block a user