Skip to content

Commit

Permalink
Reorder global variable definition for better readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed May 23, 2024
1 parent d1253b9 commit 8c775ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/opcUA_server/opcUA_server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ extern "C"
* GLOBAL VARIABLES
**************************************************************************************/

UA_Server * opc_ua_server = nullptr;

static size_t const OPC_UA_SERVER_THREAD_STACK_SIZE = 16*1024UL;
template <size_t SIZE> struct alignas(uint32_t) OPC_UA_STACK final : public std::array<uint8_t, SIZE> {};
static OPC_UA_STACK<OPC_UA_SERVER_THREAD_STACK_SIZE> OPC_UA_SERVER_THREAD_STACK;
rtos::Thread opc_ua_server_thread(osPriorityNormal, OPC_UA_SERVER_THREAD_STACK.size(), OPC_UA_SERVER_THREAD_STACK.data());

static size_t const OPC_UA_SERVER_THREAD_HEAP_SIZE = 256*1024UL;
template <size_t SIZE> struct alignas(O1HEAP_ALIGNMENT) OPC_UA_HEAP final : public std::array<uint8_t, SIZE> {};
static OPC_UA_HEAP<OPC_UA_SERVER_THREAD_HEAP_SIZE> OPC_UA_SERVER_THREAD_HEAP;

UA_Server * opc_ua_server = nullptr;
O1HeapInstance * o1heap_ins = nullptr;
rtos::Thread opc_ua_server_thread(osPriorityNormal, OPC_UA_SERVER_THREAD_STACK.size(), OPC_UA_SERVER_THREAD_STACK.data());

/**************************************************************************************
* DEFINES
**************************************************************************************/

REDIRECT_STDOUT_TO(Serial)

Expand Down

0 comments on commit 8c775ac

Please sign in to comment.