Skip to content

Commit 108a460

Browse files
committed
Fix queues and other fixes for the Windows platform
1 parent c317c77 commit 108a460

29 files changed

Lines changed: 1024 additions & 70 deletions

components/robusto/base/src/init/init_robusto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#endif
3737
#include <robusto_logging.h>
3838
#include <robusto_init_internal.h>
39-
#include <sys/queue.h>
39+
#include <robusto_sys_queue.h>
4040

4141
typedef struct service
4242
{

components/robusto/base/src/system/robusto_system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ bool robusto_gpio_get_level(uint8_t gpio_num)
198198
#elif defined(CONFIG_ROBUSTO_NETWORK_MOCK_TESTING)
199199
return 1;
200200
#else
201-
#warn "There is no GPIO implementation on the Native platform, "
201+
#warning "There is no GPIO implementation on the Native platform, "
202202
return 0;
203203
#endif
204204
}

components/robusto/include/robconfig.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@
4444
/* TODO: The STM32 platform is not properly defined, do that. It doesn't use USE_STM32, either, do that. */
4545
#define USE_STM32
4646
#else
47-
/* If it is not an MCU, it is native*/
47+
/* Not and MCU, it is native*/
4848
#define USE_NATIVE
49+
50+
/* But we also need to know if it is windows */
51+
#if defined(_WIN32) || defined(_WIN64)
52+
#define USE_WINDOWS
53+
#endif
4954
#endif
5055

5156
// TODO: We need to get a proper fix of the environments to make proper choices; ESP-IDF, Arduino and STM32. And perhaps others.

components/robusto/include/robusto_concurrency.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@
5252
typedef TaskHandle_t rob_task_handle_t;
5353
typedef SemaphoreHandle_t mutex_ref_t;
5454
#else
55+
5556
#include <semaphore.h>
56-
typedef uint32_t rob_task_handle_t;
57-
typedef pthread_mutex_t *mutex_ref_t;
57+
typedef uint32_t rob_task_handle_t;
58+
59+
#ifndef USE_WINDOWS
60+
typedef pthread_mutex_t *mutex_ref_t;
61+
#else
62+
#include <windows.h>
63+
typedef HANDLE mutex_ref_t;
64+
#endif
65+
5866
#endif
5967

6068
#ifdef __cplusplus

components/robusto/include/robusto_incoming.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <robusto_message.h>
4040
#include <robusto_peer.h>
4141
#ifndef USE_ARDUINO
42-
#include "sys/queue.h"
42+
#include <robusto_sys_queue.h>
4343
#endif
4444

4545

components/robusto/include/robusto_input.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <stdbool.h>
3939

4040
#ifndef USE_ARDUINO
41-
#include "sys/queue.h"
41+
#include <robusto_sys_queue.h>
4242
#else
4343
#include <compat/arduino_sys_queue.h>
4444
#endif

components/robusto/include/robusto_peer.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333

3434
#include <robconfig.h>
3535

36-
#ifndef USE_ARDUINO
37-
#include "sys/queue.h"
38-
#else
39-
#include <compat/arduino_sys_queue.h>
40-
#endif
36+
#include <robusto_sys_queue.h>
4137

4238
#include <stdint.h>
4339
#include <stdbool.h>

components/robusto/include/robusto_peer_def.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333

3434
#include <robconfig.h>
3535

36-
#ifndef USE_ARDUINO
37-
#include "sys/queue.h"
38-
#else
39-
#include <compat/arduino_sys_queue.h>
40-
#endif
36+
#include <robusto_sys_queue.h>
4137

4238
#include <stdint.h>
4339
#include <stdbool.h>

components/robusto/include/robusto_queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#endif
5050

5151
#ifndef USE_ARDUINO
52-
#include "sys/queue.h"
52+
#include <robusto_sys_queue.h>
5353
#endif
5454

5555
#if !(defined(USE_ESPIDF) || defined(USE_ARDUINO))

0 commit comments

Comments
 (0)