Skip to content

Commit 9dd71b4

Browse files
committed
Update u_threads with proper includes
1 parent 4024232 commit 9dd71b4

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

Core/Src/u_threads.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "u_sensors.h"
44
#include "timer.h"
55
#include "tx_api.h"
6+
#include "u_nx_ethernet.h"
7+
#include "u_ethernet.h"
68

79
/* Default Thread */
810
static thread_t _default_thread = {
@@ -56,24 +58,11 @@ void sensors_thread(ULONG thread_input) {
5658
}
5759
}
5860

59-
/* Initializes all ThreadX threads.
60-
* Calls to create_thread() should go in here
61-
*/
62-
uint8_t threads_init(TX_BYTE_POOL *byte_pool) {
63-
64-
/* Create Threads */
65-
CATCH_ERROR(create_thread(byte_pool, &_default_thread), U_SUCCESS); // Create Default thread.
66-
CATCH_ERROR(create_thread(byte_pool, &_sensors_thread), U_SUCCESS); // Create Sensors thread.
67-
68-
PRINTLN_INFO("Ran threads_init().");
69-
return U_SUCCESS;
70-
}
71-
7261
/* Incoming Ethernet Thread. Processes incoming messages. */
7362
static thread_t ethernet_incoming_thread = {
7463
.name = "Incoming Ethernet Thread", /* Name */
7564
.size = 512, /* Stack Size (in bytes) */
76-
.priority = PRIO_vEthernetIncoming, /* Priority */
65+
.priority = 2, /* Priority */
7766
.threshold = 0, /* Preemption Threshold */
7867
.time_slice = TX_NO_TIME_SLICE, /* Time Slice */
7968
.auto_start = TX_AUTO_START, /* Auto Start */
@@ -99,7 +88,7 @@ void vEthernetIncoming(ULONG thread_input) {
9988
static thread_t ethernet_outgoing_thread = {
10089
.name = "Outgoing Ethernet Thread", /* Name */
10190
.size = 512, /* Stack Size (in bytes) */
102-
.priority = PRIO_vEthernetOutgoing, /* Priority */
91+
.priority = 2, /* Priority */
10392
.threshold = 0, /* Preemption Threshold */
10493
.time_slice = TX_NO_TIME_SLICE, /* Time Slice */
10594
.auto_start = TX_AUTO_START, /* Auto Start */
@@ -124,4 +113,20 @@ void vEthernetOutgoing(ULONG thread_input) {
124113

125114
/* No sleep. Thread timing is controlled completely by the queue timeout. */
126115
}
127-
}
116+
}
117+
118+
/* Initializes all ThreadX threads.
119+
* Calls to create_thread() should go in here
120+
*/
121+
uint8_t threads_init(TX_BYTE_POOL *byte_pool) {
122+
123+
/* Create Threads */
124+
CATCH_ERROR(create_thread(byte_pool, &_default_thread), U_SUCCESS); // Create Default thread.
125+
CATCH_ERROR(create_thread(byte_pool, &_sensors_thread), U_SUCCESS); // Create Sensors thread.
126+
CATCH_ERROR(create_thread(byte_pool, &ethernet_incoming_thread), U_SUCCESS); // Create Incoming Ethernet thread.
127+
CATCH_ERROR(create_thread(byte_pool, &ethernet_outgoing_thread), U_SUCCESS); // Create Outgoing Ethernet thread.
128+
129+
PRINTLN_INFO("Ran threads_init().");
130+
return U_SUCCESS;
131+
}
132+

0 commit comments

Comments
 (0)