This commit is contained in:
MMS 2021-12-05 20:42:32 -05:00
parent 850d8fb169
commit 1dc9862913
133 changed files with 17428 additions and 5212 deletions

View File

@ -0,0 +1,22 @@
target_sources(${PROJECT_NAME}
PRIVATE
# {{BEGIN_TARGET_SOURCES}}
${CMAKE_CURRENT_LIST_DIR}/src/tx_initialize_low_level.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_restore.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_save.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_control.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_schedule.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_build.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_return.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_interrupt.c
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
target_compile_definitions(${PROJECT_NAME} PUBLIC "-D_GNU_SOURCE -DTX_LINUX_DEBUG_ENABLE")

View File

@ -0,0 +1,85 @@
CC = gcc
AR=ar cr
DEFINES = -DTX_LINUX_DEBUG_ENABLE -D_GNU_SOURCE -DTX_LINUX_MULTI_CORE -DTX_ENABLE_EVENT_TRACE
ifdef NO_IDLE
DEFINES += -DTX_LINUX_NO_IDLE_ENABLE
TITLE = "No idle"
else
TITLE = "TX"
endif
ifdef ARCH64
TITLE+=":64"
else
TITLE+=":32"
ARCH = -m32
endif
COMMON_PATH=$(DIR)/../../../../common
INCLUDES = -I$(COMMON_PATH)/inc -I$(DIR)/../inc
CFLAGS = -g3 $(ARCH) -g3 -fPIC -gdwarf-2 -std=c99 $(DEFINES) $(INCLUDES)
LINK = gcc $(ARCH)
LIBS = -lpthread -lrt
FILE_LIST = file_list.mk
DEPEND_LIST = $(OUTPUT_FOLDER)/*.d
OUTPUT_FOLDER= .tmp
DIR=$(shell pwd)
include $(FILE_LIST)
all: $(OUTPUT_FOLDER) sample_threadx tx.so
echo $(TITLE) build done
$(OUTPUT_FOLDER):
mkdir -p $@
mkdir -p $@/generic/
sample_threadx: $(OUTPUT_FOLDER)/sample_threadx.o tx.a
echo LD $@
$(LINK) -o $@ $^ $(LIBS)
tx.a: $(OUTPUT_FOLDER) $(LINUX_OBJS) $(GENERIC_OBJS)
echo AR $@
$(AR) $@ $(LINUX_OBJS) $(GENERIC_OBJS)
tx.so: $(OUTPUT_FOLDER) $(LINUX_OBJS) $(GENERIC_OBJS)
cc -fPIC -shared -Wl,-soname,$@ -o $@ $(LINUX_OBJS) $(GENERIC_OBJS) $(LIBS) $(ARCH)
$(OUTPUT_FOLDER)/sample_threadx.o: sample_threadx.c $(DIR)/Makefile
filename=`basename $<`; \
echo CC $$filename; \
$(CC) $(CFLAGS) -MT $@ -MD -MP -MF $(OUTPUT_FOLDER)/$$filename.d -c -o $@ $<
$(OUTPUT_FOLDER)/%.o: ../src/%.c $(DIR)/Makefile
filename=`basename $<`; \
echo CC $$filename; \
$(CC) $(CFLAGS) -MT $@ -MD -MP -MF $(OUTPUT_FOLDER)/$$filename.d -c -o $@ $<
$(OUTPUT_FOLDER)/generic/%.o: $(COMMON_PATH)/src/%.c $(DIR)/Makefile
filename=`basename $<`; \
echo CC $$filename; \
$(CC) $(CFLAGS) -MT $@ -MD -MP -MF $(OUTPUT_FOLDER)/$$filename.d -c -o $@ $<
-include $(DEPEND_LIST)
.SILENT:
.PHONY: files clean
files:
@echo "LINUX_SRCS = \\" > $(FILE_LIST);
-@for file in *.c; \
do \
filename=`basename $$file`; \
[ "$$file" == "sample_threadx.c" ] || echo "$$filename \\" >> $(FILE_LIST); \
done;
@printf "\n" >> $(FILE_LIST);
@echo 'LINUX_OBJS = $$(LINUX_SRCS:%.c=$(OUTPUT_FOLDER)/%.o)' >> $(FILE_LIST);
@printf "\n\n" >> $(FILE_LIST);
@echo "GENERIC_SRCS = \\" >> $(FILE_LIST);
-@for file in $(COMMON_PATH)/src/*.c; \
do \
filename=`basename $$file`; \
[ "$$file" == "sample_threadx.c" ] || echo "$$filename \\" >> $(FILE_LIST); \
done;
@printf "\n" >> $(FILE_LIST);
@echo 'GENERIC_OBJS = $$(GENERIC_SRCS:%.c=$(OUTPUT_FOLDER)/generic/%.o)' >> $(FILE_LIST);
clean:
-rm -f -r $(OUTPUT_FOLDER) tx.a sample_threadx tx.so

View File

@ -0,0 +1,201 @@
LINUX_SRCS = \
tx_initialize_low_level.c \
tx_thread_context_restore.c \
tx_thread_context_save.c \
tx_thread_interrupt_control.c \
tx_thread_schedule.c \
tx_thread_stack_build.c \
tx_thread_system_return.c \
tx_timer_interrupt.c \
LINUX_OBJS = $(LINUX_SRCS:%.c=.tmp/%.o)
GENERIC_SRCS = \
tx_block_allocate.c \
tx_block_pool_cleanup.c \
tx_block_pool_create.c \
tx_block_pool_delete.c \
tx_block_pool_info_get.c \
tx_block_pool_initialize.c \
tx_block_pool_performance_info_get.c \
tx_block_pool_performance_system_info_get.c \
tx_block_pool_prioritize.c \
tx_block_release.c \
tx_byte_allocate.c \
tx_byte_pool_cleanup.c \
tx_byte_pool_create.c \
tx_byte_pool_delete.c \
tx_byte_pool_info_get.c \
tx_byte_pool_initialize.c \
tx_byte_pool_performance_info_get.c \
tx_byte_pool_performance_system_info_get.c \
tx_byte_pool_prioritize.c \
tx_byte_pool_search.c \
tx_byte_release.c \
txe_block_allocate.c \
txe_block_pool_create.c \
txe_block_pool_delete.c \
txe_block_pool_info_get.c \
txe_block_pool_prioritize.c \
txe_block_release.c \
txe_byte_allocate.c \
txe_byte_pool_create.c \
txe_byte_pool_delete.c \
txe_byte_pool_info_get.c \
txe_byte_pool_prioritize.c \
txe_byte_release.c \
txe_event_flags_create.c \
txe_event_flags_delete.c \
txe_event_flags_get.c \
txe_event_flags_info_get.c \
txe_event_flags_set.c \
txe_event_flags_set_notify.c \
txe_mutex_create.c \
txe_mutex_delete.c \
txe_mutex_get.c \
txe_mutex_info_get.c \
txe_mutex_prioritize.c \
txe_mutex_put.c \
txe_queue_create.c \
txe_queue_delete.c \
txe_queue_flush.c \
txe_queue_front_send.c \
txe_queue_info_get.c \
txe_queue_prioritize.c \
txe_queue_receive.c \
txe_queue_send.c \
txe_queue_send_notify.c \
txe_semaphore_ceiling_put.c \
txe_semaphore_create.c \
txe_semaphore_delete.c \
txe_semaphore_get.c \
txe_semaphore_info_get.c \
txe_semaphore_prioritize.c \
txe_semaphore_put.c \
txe_semaphore_put_notify.c \
txe_thread_create.c \
txe_thread_delete.c \
txe_thread_entry_exit_notify.c \
txe_thread_info_get.c \
txe_thread_preemption_change.c \
txe_thread_priority_change.c \
txe_thread_relinquish.c \
txe_thread_reset.c \
txe_thread_resume.c \
txe_thread_suspend.c \
txe_thread_terminate.c \
txe_thread_time_slice_change.c \
txe_thread_wait_abort.c \
txe_timer_activate.c \
txe_timer_change.c \
txe_timer_create.c \
txe_timer_deactivate.c \
txe_timer_delete.c \
txe_timer_info_get.c \
tx_event_flags_cleanup.c \
tx_event_flags_create.c \
tx_event_flags_delete.c \
tx_event_flags_get.c \
tx_event_flags_info_get.c \
tx_event_flags_initialize.c \
tx_event_flags_performance_info_get.c \
tx_event_flags_performance_system_info_get.c \
tx_event_flags_set.c \
tx_event_flags_set_notify.c \
tx_initialize_high_level.c \
tx_initialize_kernel_enter.c \
tx_initialize_kernel_setup.c \
tx_misra.c \
tx_mutex_cleanup.c \
tx_mutex_create.c \
tx_mutex_delete.c \
tx_mutex_get.c \
tx_mutex_info_get.c \
tx_mutex_initialize.c \
tx_mutex_performance_info_get.c \
tx_mutex_performance_system_info_get.c \
tx_mutex_prioritize.c \
tx_mutex_priority_change.c \
tx_mutex_put.c \
tx_queue_cleanup.c \
tx_queue_create.c \
tx_queue_delete.c \
tx_queue_flush.c \
tx_queue_front_send.c \
tx_queue_info_get.c \
tx_queue_initialize.c \
tx_queue_performance_info_get.c \
tx_queue_performance_system_info_get.c \
tx_queue_prioritize.c \
tx_queue_receive.c \
tx_queue_send.c \
tx_queue_send_notify.c \
tx_semaphore_ceiling_put.c \
tx_semaphore_cleanup.c \
tx_semaphore_create.c \
tx_semaphore_delete.c \
tx_semaphore_get.c \
tx_semaphore_info_get.c \
tx_semaphore_initialize.c \
tx_semaphore_performance_info_get.c \
tx_semaphore_performance_system_info_get.c \
tx_semaphore_prioritize.c \
tx_semaphore_put.c \
tx_semaphore_put_notify.c \
tx_thread_create.c \
tx_thread_delete.c \
tx_thread_entry_exit_notify.c \
tx_thread_identify.c \
tx_thread_info_get.c \
tx_thread_initialize.c \
tx_thread_performance_info_get.c \
tx_thread_performance_system_info_get.c \
tx_thread_preemption_change.c \
tx_thread_priority_change.c \
tx_thread_relinquish.c \
tx_thread_reset.c \
tx_thread_resume.c \
tx_thread_shell_entry.c \
tx_thread_sleep.c \
tx_thread_stack_analyze.c \
tx_thread_stack_error_handler.c \
tx_thread_stack_error_notify.c \
tx_thread_suspend.c \
tx_thread_system_preempt_check.c \
tx_thread_system_resume.c \
tx_thread_system_suspend.c \
tx_thread_terminate.c \
tx_thread_timeout.c \
tx_thread_time_slice.c \
tx_thread_time_slice_change.c \
tx_thread_wait_abort.c \
tx_time_get.c \
tx_timer_activate.c \
tx_timer_change.c \
tx_timer_create.c \
tx_timer_deactivate.c \
tx_timer_delete.c \
tx_timer_expiration_process.c \
tx_timer_info_get.c \
tx_timer_initialize.c \
tx_timer_performance_info_get.c \
tx_timer_performance_system_info_get.c \
tx_timer_system_activate.c \
tx_timer_system_deactivate.c \
tx_timer_thread_entry.c \
tx_time_set.c \
tx_trace_buffer_full_notify.c \
tx_trace_disable.c \
tx_trace_enable.c \
tx_trace_event_filter.c \
tx_trace_event_unfilter.c \
tx_trace_initialize.c \
tx_trace_interrupt_control.c \
tx_trace_isr_enter_insert.c \
tx_trace_isr_exit_insert.c \
tx_trace_object_register.c \
tx_trace_object_unregister.c \
tx_trace_user_event_insert.c \
GENERIC_OBJS = $(GENERIC_SRCS:%.c=.tmp/generic/%.o)

View File

@ -0,0 +1,380 @@
/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight
threads of different priorities, using a message queue, semaphore, mutex, event flags group,
byte pool, and block pool. */
#include "tx_api.h"
#include <stdio.h>
#define DEMO_STACK_SIZE 1024
#define DEMO_BYTE_POOL_SIZE 9120
#define DEMO_BLOCK_POOL_SIZE 100
#define DEMO_QUEUE_SIZE 100
/* Define the ThreadX object control blocks... */
TX_THREAD thread_0;
TX_THREAD thread_1;
TX_THREAD thread_2;
TX_THREAD thread_3;
TX_THREAD thread_4;
TX_THREAD thread_5;
TX_THREAD thread_6;
TX_THREAD thread_7;
TX_QUEUE queue_0;
TX_SEMAPHORE semaphore_0;
TX_MUTEX mutex_0;
TX_EVENT_FLAGS_GROUP event_flags_0;
TX_BYTE_POOL byte_pool_0;
TX_BLOCK_POOL block_pool_0;
/* Define the counters used in the demo application... */
ULONG thread_0_counter;
ULONG thread_1_counter;
ULONG thread_1_messages_sent;
ULONG thread_2_counter;
ULONG thread_2_messages_received;
ULONG thread_3_counter;
ULONG thread_4_counter;
ULONG thread_5_counter;
ULONG thread_6_counter;
ULONG thread_7_counter;
/* Define thread prototypes. */
void thread_0_entry(ULONG thread_input);
void thread_1_entry(ULONG thread_input);
void thread_2_entry(ULONG thread_input);
void thread_3_and_4_entry(ULONG thread_input);
void thread_5_entry(ULONG thread_input);
void thread_6_and_7_entry(ULONG thread_input);
/* Define main entry point. */
int main()
{
/* Enter the ThreadX kernel. */
tx_kernel_enter();
}
/* Define what the initial system looks like. */
void tx_application_define(void *first_unused_memory)
{
CHAR *pointer = TX_NULL;
/* Create a byte memory pool from which to allocate the thread stacks. */
tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE);
/* Put system definition stuff in here, e.g. thread creates and other assorted
create information. */
/* Allocate the stack for thread 0. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create the main thread. */
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, DEMO_STACK_SIZE,
1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 1. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 1 and 2. These threads pass information through a ThreadX
message queue. It is also interesting to note that these threads have a time
slice. */
tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 2. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 3. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore.
An interesting thing here is that both threads share the same instruction area. */
tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 4. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 5. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create thread 5. This thread simply pends on an event flag which will be set
by thread_0. */
tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, DEMO_STACK_SIZE,
4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 6. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 6 and 7. These threads compete for a ThreadX mutex. */
tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 7. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the message queue. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT);
/* Create the message queue shared by threads 1 and 2. */
tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG));
/* Create the semaphore used by threads 3 and 4. */
tx_semaphore_create(&semaphore_0, "semaphore 0", 1);
/* Create the event flags group used by threads 1 and 5. */
tx_event_flags_create(&event_flags_0, "event flags 0");
/* Create the mutex used by thread 6 and 7 without priority inheritance. */
tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT);
/* Allocate the memory for a small block pool. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT);
/* Create a block memory pool to allocate a message buffer from. */
tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE);
/* Allocate a block and release the block memory. */
tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT);
/* Release the block back to the pool. */
tx_block_release(pointer);
}
/* Define the test threads. */
void thread_0_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sits in while-forever-sleep loop. */
while(1)
{
/* Increment the thread counter. */
thread_0_counter++;
/* Print results. */
printf("**** ThreadX Linux Demonstration **** (c) 1996-2020 Microsoft Corporation\n\n");
printf(" thread 0 events sent: %lu\n", thread_0_counter);
printf(" thread 1 messages sent: %lu\n", thread_1_counter);
printf(" thread 2 messages received: %lu\n", thread_2_counter);
printf(" thread 3 obtained semaphore: %lu\n", thread_3_counter);
printf(" thread 4 obtained semaphore: %lu\n", thread_4_counter);
printf(" thread 5 events received: %lu\n", thread_5_counter);
printf(" thread 6 mutex obtained: %lu\n", thread_6_counter);
printf(" thread 7 mutex obtained: %lu\n\n", thread_7_counter);
/* Sleep for 10 ticks. */
tx_thread_sleep(10);
/* Set event flag 0 to wakeup thread 5. */
status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_1_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sends messages to a queue shared by thread 2. */
while(1)
{
/* Increment the thread counter. */
thread_1_counter++;
/* Send message to queue 0. */
status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER);
/* Check completion status. */
if (status != TX_SUCCESS)
break;
/* Increment the message sent. */
thread_1_messages_sent++;
}
}
void thread_2_entry(ULONG thread_input)
{
ULONG received_message;
UINT status;
/* This thread retrieves messages placed on the queue by thread 1. */
while(1)
{
/* Increment the thread counter. */
thread_2_counter++;
/* Retrieve a message from the queue. */
status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER);
/* Check completion status and make sure the message is what we
expected. */
if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received))
break;
/* Otherwise, all is okay. Increment the received message count. */
thread_2_messages_received++;
}
}
void thread_3_and_4_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 3 and thread 4. As the loop
below shows, these function compete for ownership of semaphore_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 3)
thread_3_counter++;
else
thread_4_counter++;
/* Get the semaphore with suspension. */
status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the semaphore. */
tx_thread_sleep(2);
/* Release the semaphore. */
status = tx_semaphore_put(&semaphore_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_5_entry(ULONG thread_input)
{
UINT status;
ULONG actual_flags;
/* This thread simply waits for an event in a forever loop. */
while(1)
{
/* Increment the thread counter. */
thread_5_counter++;
/* Wait for event flag 0. */
status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR,
&actual_flags, TX_WAIT_FOREVER);
/* Check status. */
if ((status != TX_SUCCESS) || (actual_flags != 0x1))
break;
}
}
void thread_6_and_7_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 6 and thread 7. As the loop
below shows, these function compete for ownership of mutex_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 6)
thread_6_counter++;
else
thread_7_counter++;
/* Get the mutex with suspension. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Get the mutex again with suspension. This shows
that an owning thread may retrieve the mutex it
owns multiple times. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the mutex. */
tx_thread_sleep(2);
/* Release the mutex. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Release the mutex again. This will actually
release ownership since it was obtained twice. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}

View File

@ -0,0 +1,575 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* tx_port.h Linux/GNU */
/* 6.1 */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This file contains data type definitions that make the ThreadX */
/* real-time kernel function identically on a variety of different */
/* processor architectures. For example, the size or number of bits */
/* in an "int" data type vary between microprocessor architectures and */
/* even C compilers for the same microprocessor. ThreadX does not */
/* directly use native C data types. Instead, ThreadX creates its */
/* own special types that can be mapped to actual data types by this */
/* file to guarantee consistency in the interface and functionality. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
#ifndef TX_PORT_H
#define TX_PORT_H
#define TX_MAX_PRIORITIES 32
/* #define TX_MISRA_ENABLE */
/* #define TX_INLINE_INITIALIZATION */
/* #define TX_NOT_INTERRUPTABLE */
/* #define TX_TIMER_PROCESS_IN_ISR */
/* #define TX_REACTIVATE_INLINE */
/* #define TX_DISABLE_STACK_FILLING */
/* #define TX_ENABLE_STACK_CHECKING */
/* #define TX_DISABLE_PREEMPTION_THRESHOLD */
/* #define TX_DISABLE_REDUNDANT_CLEARING */
/* #define TX_DISABLE_NOTIFY_CALLBACKS */
/* #define TX_INLINE_THREAD_RESUME_SUSPEND */
/* #define TX_ENABLE_EVENT_TRACE */
/* For MISRA, define enable performance info. Also, for MISRA TX_DISABLE_NOTIFY_CALLBACKS should not be defined. */
/* #define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
#define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
#define TX_MUTEX_ENABLE_PERFORMANCE_INFO
#define TX_QUEUE_ENABLE_PERFORMANCE_INFO
#define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
#define TX_THREAD_ENABLE_PERFORMANCE_INFO
#define TX_TIMER_ENABLE_PERFORMANCE_INFO */
/* Determine if the optional ThreadX user define file should be used. */
#ifdef TX_INCLUDE_USER_DEFINE_FILE
/* Yes, include the user defines in tx_user.h. The defines in this file may
alternately be defined on the command line. */
#include "tx_user.h"
#endif
/* Define compiler library include files. */
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#ifndef __USE_POSIX199309
#define __USE_POSIX199309
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#undef __USE_POSIX199309
#else /* __USE_POSIX199309 */
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#endif /* __USE_POSIX199309 */
/* Define ThreadX basic types for this port. */
typedef void VOID;
typedef char CHAR;
typedef unsigned char UCHAR;
typedef int INT;
typedef unsigned int UINT;
#if __x86_64__
typedef int LONG;
typedef unsigned int ULONG;
#else /* __x86_64__ */
typedef long LONG;
typedef unsigned long ULONG;
#endif /* __x86_64__ */
typedef short SHORT;
typedef unsigned short USHORT;
typedef uint64_t ULONG64;
/* Override the alignment type to use 64-bit alignment and storage for pointers. */
#if __x86_64__
#define ALIGN_TYPE_DEFINED
typedef unsigned long long ALIGN_TYPE;
/* Override the free block marker for byte pools to be a 64-bit constant. */
#define TX_BYTE_BLOCK_FREE ((ALIGN_TYPE) 0xFFFFEEEEFFFFEEEE)
#endif
/* Define automated coverage test extensions... These are required for the
ThreadX regression test. */
typedef unsigned int TEST_FLAG;
extern TEST_FLAG threadx_byte_allocate_loop_test;
extern TEST_FLAG threadx_byte_release_loop_test;
extern TEST_FLAG threadx_mutex_suspension_put_test;
extern TEST_FLAG threadx_mutex_suspension_priority_test;
#ifndef TX_TIMER_PROCESS_IN_ISR
extern TEST_FLAG threadx_delete_timer_thread;
#endif
extern void abort_and_resume_byte_allocating_thread(void);
extern void abort_all_threads_suspended_on_mutex(void);
extern void suspend_lowest_priority(void);
#ifndef TX_TIMER_PROCESS_IN_ISR
extern void delete_timer_thread(void);
#endif
extern TEST_FLAG test_stack_analyze_flag;
extern TEST_FLAG test_initialize_flag;
extern TEST_FLAG test_forced_mutex_timeout;
#ifdef TX_REGRESSION_TEST
/* Define extension macros for automated coverage tests. */
#define TX_BYTE_ALLOCATE_EXTENSION if (threadx_byte_allocate_loop_test == ((TEST_FLAG) 1)) \
{ \
pool_ptr -> tx_byte_pool_owner = TX_NULL; \
threadx_byte_allocate_loop_test = ((TEST_FLAG) 0); \
}
#define TX_BYTE_RELEASE_EXTENSION if (threadx_byte_release_loop_test == ((TEST_FLAG) 1)) \
{ \
threadx_byte_release_loop_test = ((TEST_FLAG) 0); \
abort_and_resume_byte_allocating_thread(); \
}
#define TX_MUTEX_PUT_EXTENSION_1 if (threadx_mutex_suspension_put_test == ((TEST_FLAG) 1)) \
{ \
threadx_mutex_suspension_put_test = ((TEST_FLAG) 0); \
abort_all_threads_suspended_on_mutex(); \
}
#define TX_MUTEX_PUT_EXTENSION_2 if (test_forced_mutex_timeout == ((TEST_FLAG) 1)) \
{ \
test_forced_mutex_timeout = ((TEST_FLAG) 0); \
_tx_thread_wait_abort(mutex_ptr -> tx_mutex_suspension_list); \
}
#define TX_MUTEX_PRIORITY_CHANGE_EXTENSION if (threadx_mutex_suspension_priority_test == ((TEST_FLAG) 1)) \
{ \
threadx_mutex_suspension_priority_test = ((TEST_FLAG) 0); \
suspend_lowest_priority(); \
}
#ifndef TX_TIMER_PROCESS_IN_ISR
#define TX_TIMER_INITIALIZE_EXTENSION(a) if (threadx_delete_timer_thread == ((TEST_FLAG) 1)) \
{ \
threadx_delete_timer_thread = ((TEST_FLAG) 0); \
delete_timer_thread(); \
(a) = ((UINT) 1); \
}
#endif
#define TX_THREAD_STACK_ANALYZE_EXTENSION if (test_stack_analyze_flag == ((TEST_FLAG) 1)) \
{ \
thread_ptr -> tx_thread_id = ((TEST_FLAG) 0); \
test_stack_analyze_flag = ((TEST_FLAG) 0); \
} \
else if (test_stack_analyze_flag == ((TEST_FLAG) 2)) \
{ \
stack_ptr = thread_ptr -> tx_thread_stack_start; \
test_stack_analyze_flag = ((TEST_FLAG) 0); \
} \
else if (test_stack_analyze_flag == ((TEST_FLAG) 3)) \
{ \
*stack_ptr = TX_STACK_FILL; \
test_stack_analyze_flag = ((TEST_FLAG) 0); \
} \
else \
{ \
test_stack_analyze_flag = ((TEST_FLAG) 0); \
}
#define TX_INITIALIZE_KERNEL_ENTER_EXTENSION if (test_initialize_flag == ((TEST_FLAG) 1)) \
{ \
test_initialize_flag = ((TEST_FLAG) 0); \
return; \
}
#endif
/* Add Linux debug insert prototype. */
void _tx_linux_debug_entry_insert(char *action, char *file, unsigned long line);
#ifndef TX_LINUX_DEBUG_ENABLE
/* If Linux debug is not enabled, turn logging into white-space. */
#define _tx_linux_debug_entry_insert(a, b, c)
#endif
/* Define the TX_MEMSET macro to remove library reference. */
#ifndef TX_MISRA_ENABLE
#define TX_MEMSET(a,b,c) { \
UCHAR *ptr; \
UCHAR value; \
UINT i, size; \
ptr = (UCHAR *) ((VOID *) a); \
value = (UCHAR) b; \
size = (UINT) c; \
for (i = 0; i < size; i++) \
{ \
*ptr++ = value; \
} \
}
#endif
/* Define the priority levels for ThreadX. Legal values range
from 32 to 1024 and MUST be evenly divisible by 32. */
#ifndef TX_MAX_PRIORITIES
#define TX_MAX_PRIORITIES 32
#endif
/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during
thread creation is less than this value, the thread create call will return an error. */
#ifndef TX_MINIMUM_STACK
#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */
#endif
/* Define the system timer thread's default stack size and priority. These are only applicable
if TX_TIMER_PROCESS_IN_ISR is not defined. */
#ifndef TX_TIMER_THREAD_STACK_SIZE
#define TX_TIMER_THREAD_STACK_SIZE 400 /* Default timer thread stack size - Not used in Linux port! */
#endif
#ifndef TX_TIMER_THREAD_PRIORITY
#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */
#endif
/* Define various constants for the ThreadX port. */
#define TX_INT_DISABLE 1 /* Disable interrupts */
#define TX_INT_ENABLE 0 /* Enable interrupts */
/* Define the clock source for trace event entry time stamp. The following two item are port specific.
For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock
source constants would be:
#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024)
#define TX_TRACE_TIME_MASK 0x0000FFFFUL
*/
#ifndef TX_MISRA_ENABLE
#ifndef TX_TRACE_TIME_SOURCE
#define TX_TRACE_TIME_SOURCE ((ULONG) (_tx_linux_time_stamp.tv_nsec));
#endif
#else
ULONG _tx_misra_time_stamp_get(VOID);
#define TX_TRACE_TIME_SOURCE _tx_misra_time_stamp_get()
#endif
#ifndef TX_TRACE_TIME_MASK
#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL
#endif
/* Define the port-specific trace extension to pickup the Windows timer. */
#define TX_TRACE_PORT_EXTENSION clock_gettime(CLOCK_REALTIME, &_tx_linux_time_stamp);
/* Define the port specific options for the _tx_build_options variable. This variable indicates
how the ThreadX library was built. */
#define TX_PORT_SPECIFIC_BUILD_OPTIONS 0
/* Define the in-line initialization constant so that modules with in-line
initialization capabilities can prevent their initialization from being
a function call. */
#ifdef TX_MISRA_ENABLE
#define TX_DISABLE_INLINE
#else
#define TX_INLINE_INITIALIZATION
#endif
/* Define the Linux-specific initialization code that is expanded in the generic source. */
void _tx_initialize_start_interrupts(void);
#define TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION _tx_initialize_start_interrupts();
/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is
disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack
checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING
define is negated, thereby forcing the stack fill which is necessary for the stack checking
logic. */
#ifndef TX_MISRA_ENABLE
#ifdef TX_ENABLE_STACK_CHECKING
#undef TX_DISABLE_STACK_FILLING
#endif
#endif
/* Define the TX_THREAD control block extensions for this port. The main reason
for the multiple macros is so that backward compatibility can be maintained with
existing ThreadX kernel awareness modules. */
#define TX_THREAD_EXTENSION_0 pthread_t tx_thread_linux_thread_id; \
sem_t tx_thread_linux_thread_run_semaphore; \
UINT tx_thread_linux_suspension_type; \
UINT tx_thread_linux_int_disabled_flag;
#define TX_THREAD_EXTENSION_1 VOID *tx_thread_extension_ptr;
#define TX_THREAD_EXTENSION_2
#define TX_THREAD_EXTENSION_3
/* Define the port extensions of the remaining ThreadX objects. */
#define TX_BLOCK_POOL_EXTENSION
#define TX_BYTE_POOL_EXTENSION
#define TX_EVENT_FLAGS_GROUP_EXTENSION
#define TX_MUTEX_EXTENSION
#define TX_QUEUE_EXTENSION
#define TX_SEMAPHORE_EXTENSION
#define TX_TIMER_EXTENSION
/* Define the user extension field of the thread control block. Nothing
additional is needed for this port so it is defined as white space. */
#ifndef TX_THREAD_USER_EXTENSION
#define TX_THREAD_USER_EXTENSION
#endif
/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete,
tx_thread_shell_entry, and tx_thread_terminate. */
#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr)
/* Define the ThreadX object creation extensions for the remaining objects. */
#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr)
#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr)
#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr)
#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr)
#define TX_QUEUE_CREATE_EXTENSION(queue_ptr)
#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr)
#define TX_TIMER_CREATE_EXTENSION(timer_ptr)
/* Define the ThreadX object deletion extensions for the remaining objects. */
#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr)
#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr)
#define TX_QUEUE_DELETE_EXTENSION(queue_ptr)
#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr)
#define TX_TIMER_DELETE_EXTENSION(timer_ptr)
struct TX_THREAD_STRUCT;
/* Define post completion processing for tx_thread_delete, so that the Linux thread resources are properly removed. */
void _tx_thread_delete_port_completion(struct TX_THREAD_STRUCT *thread_ptr, UINT tx_saved_posture);
#define TX_THREAD_DELETE_PORT_COMPLETION(thread_ptr) _tx_thread_delete_port_completion(thread_ptr, tx_saved_posture);
/* Define post completion processing for tx_thread_reset, so that the Linux thread resources are properly removed. */
void _tx_thread_reset_port_completion(struct TX_THREAD_STRUCT *thread_ptr, UINT tx_saved_posture);
#define TX_THREAD_RESET_PORT_COMPLETION(thread_ptr) _tx_thread_reset_port_completion(thread_ptr, tx_saved_posture);
#if __x86_64__
/* Define the ThreadX object deletion extensions for the remaining objects. */
#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr)
#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr)
#define TX_QUEUE_DELETE_EXTENSION(queue_ptr)
#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr)
#define TX_TIMER_DELETE_EXTENSION(timer_ptr)
/* Define the internal timer extension to also hold the thread pointer such that _tx_thread_timeout
can figure out what thread timeout to process. */
#define TX_TIMER_INTERNAL_EXTENSION VOID *tx_timer_internal_extension_ptr;
/* Define the thread timeout setup logic in _tx_thread_create. */
#define TX_THREAD_CREATE_TIMEOUT_SETUP(t) (t) -> tx_thread_timer.tx_timer_internal_timeout_function = &(_tx_thread_timeout); \
(t) -> tx_thread_timer.tx_timer_internal_timeout_param = 0; \
(t) -> tx_thread_timer.tx_timer_internal_extension_ptr = (VOID *) (t);
/* Define the thread timeout pointer setup in _tx_thread_timeout. */
#define TX_THREAD_TIMEOUT_POINTER_SETUP(t) (t) = (TX_THREAD *) _tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr;
#endif /* __x86_64__ */
/* Define ThreadX interrupt lockout and restore macros for protection on
access of critical kernel information. The restore interrupt macro must
restore the interrupt posture of the running thread prior to the value
present prior to the disable macro. In most cases, the save area macro
is used to define a local function save area for the disable and restore
macros. */
UINT _tx_thread_interrupt_disable(void);
VOID _tx_thread_interrupt_restore(UINT previous_posture);
#define TX_INTERRUPT_SAVE_AREA UINT tx_saved_posture;
#ifndef TX_LINUX_DEBUG_ENABLE
#define TX_DISABLE tx_saved_posture = _tx_thread_interrupt_disable();
#define TX_RESTORE _tx_thread_interrupt_restore(tx_saved_posture);
#else
#define TX_DISABLE _tx_linux_debug_entry_insert("DISABLE", __FILE__, __LINE__); \
tx_saved_posture = _tx_thread_interrupt_disable();
#define TX_RESTORE _tx_linux_debug_entry_insert("RESTORE", __FILE__, __LINE__); \
_tx_thread_interrupt_restore(tx_saved_posture);
#endif /* TX_LINUX_DEBUG_ENABLE */
#define tx_linux_mutex_lock(p) pthread_mutex_lock(&p)
#define tx_linux_mutex_unlock(p) pthread_mutex_unlock(&p)
#define tx_linux_mutex_recursive_unlock(p) {\
int _recursive_count = (int)tx_linux_mutex_recursive_count;\
while(_recursive_count)\
{\
pthread_mutex_unlock(&p);\
_recursive_count--;\
}\
}
#define tx_linux_mutex_recursive_count _tx_linux_mutex.__data.__count
#define tx_linux_sem_post(p) tx_linux_mutex_lock(_tx_linux_mutex);\
sem_post(p);\
tx_linux_mutex_unlock(_tx_linux_mutex)
#define tx_linux_sem_post_nolock(p) sem_post(p)
#define tx_linux_sem_wait(p) sem_wait(p)
/* Define the interrupt lockout macros for each ThreadX object. */
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
#define TX_BYTE_POOL_DISABLE TX_DISABLE
#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE
#define TX_MUTEX_DISABLE TX_DISABLE
#define TX_QUEUE_DISABLE TX_DISABLE
#define TX_SEMAPHORE_DISABLE TX_DISABLE
/* Define the version ID of ThreadX. This may be utilized by the application. */
#ifdef TX_THREAD_INIT
CHAR _tx_version_id[] =
"Copyright (c) Microsoft Corporation * ThreadX Linux/gcc Version 6.1 *";
#else
extern CHAR _tx_version_id[];
#endif
/* Define externals for the Linux port of ThreadX. */
extern pthread_mutex_t _tx_linux_mutex;
extern sem_t _tx_linux_semaphore;
extern sem_t _tx_linux_semaphore_no_idle;
extern ULONG _tx_linux_global_int_disabled_flag;
extern struct timespec _tx_linux_time_stamp;
extern __thread int _tx_linux_threadx_thread;
/* Define functions for linux thread. */
void _tx_linux_thread_suspend(pthread_t thread_id);
void _tx_linux_thread_resume(pthread_t thread_id);
void _tx_linux_thread_init();
#ifndef TX_LINUX_MEMORY_SIZE
#define TX_LINUX_MEMORY_SIZE 64000
#endif
#define TX_TIMER_TICKS_PER_SECOND 100UL
/* Define priorities of pthreads. */
#define TX_LINUX_PRIORITY_SCHEDULE (3)
#define TX_LINUX_PRIORITY_ISR (2)
#define TX_LINUX_PRIORITY_USER_THREAD (1)
#endif

View File

@ -0,0 +1,155 @@
Microsoft's Azure RTOS ThreadX for Linux
Using the GNU GCC Tools
1. Building the ThreadX run-time Library
First make sure you are in the "example_build" directory. Also, make sure that
you have setup your path and other environment variables necessary for the GNU
development environment. The following command retrieves and installs GCC
multilib on a Ubuntu system:
sudo apt-get install gcc-multilib
At this point you may run the GNU make command to build the ThreadX core
library. This will build the ThreadX run-time environment in the
"example_build" directory.
make tx.a
you should now observe the compilation of the ThreadX library source. At the
end of the make, they are all combined into the run-time library file: tx.a.
This file must be linked with your application in order to use ThreadX.
2. Demonstration System
Building the demonstration is easy; simply execute the GNU make command while
inside the "example_build" directory.
make sample_threadx
You should observe the compilation of sample_threadx.c (which is the demonstration
application) and linking with tx.a. The resulting file DEMO is a binary file
that can be executed.
3. System Initialization
The system entry point is at main(), which is defined in the application.
Once the application calls tx_kernel_enter, ThreadX starts running and
performs various initialization duties prior to starting the scheduler. The
Linux-specific initialization is done in the function _tx_initialize_low_level,
which is located in the file tx_initialize_low_level.c. This function is
responsible for setting up various system data structures and simulated
interrupts - including the periodic timer interrupt source for ThreadX.
In addition, _tx_initialize_low_level determines the first available
address for use by the application. In Linux, this is basically done
by using malloc to get a big block of memory from Linux.
4. Linux Implementation
ThreadX for Linux is implemented using POSIX pthreads. Each application
thread in ThreadX actually runs as a Linux pthread. The determination of
which application thread to run is made by the ThreadX scheduler, which
itself is a Linux pthread. The ThreadX scheduler is the highest priority
thread in the system.
Interrupts in ThreadX/Linux are also simulated by pthreads. A good example
is the ThreadX system timer interrupt, which can be found in
tx_initialize_low_level.c.
ThreadX for linux utilizes the API pthread_setschedparam() which requires
the ThreadX application running with privilege. The following command is used
to run a ThreadX application:
./sample_threadx
5. Improving Performance
The distribution version of ThreadX is built without any compiler
optimizations. This makes it easy to debug because you can trace or set
breakpoints inside of ThreadX itself. Of course, this costs some
performance. To make it run faster, you can change the makefile to
enable all compiler optimizations. In addition, you can eliminate the
ThreadX basic API error checking by compiling your application code with the
symbol TX_DISABLE_ERROR_CHECKING defined.
6. Interrupt Handling
ThreadX provides simulated interrupt handling with Linux pthreads. Simulated
interrupt threads may be created by the application or may be added to the
simulated timer interrupt defined in tx_initialize_low_level.c. The following
format for creating simulated interrupts should be used:
6.1 Data structures
Here is an example of how to define the Linux data structures and prototypes
necessary to create a simulated interrupt thread:
pthread_t _sample_linux_interrupt_thread;
void *_sample_linux_interrupt_entry(void *p);
6.2 Creating a Simulated Interrupt Thread
Here is an example of how to create a simulated interrupt thread in Linux.
This may be done inside of tx_initialize_low_level.c or from your application code
struct sched_param sp;
/* Create the ISR thread */
pthread_create(&_sample_linux_interrupt_thread, NULL, _sample_linux_interrupt_entry, &_sample_linux_interrupt_thread);
/* Set up the ISR priority */
sp.sched_priority = TX_LINUX_PRIORITY_ISR;
pthread_setschedparam(_sample_linux_interrupt_thread, SCHED_FIFO, &sp);
6.3 Simulated Interrupt Thread Template
The following is a template for the simulated interrupt thread. This interrupt will occur on
a periodic basis.
void *_sample_linux_interrupt_entry(void *p)
{
struct timespec ts;
while(1)
{
ts.tv_sec = 0;
ts.tv_nsec = 10000;
while(nanosleep(&ts, &ts));
/* Call ThreadX context save for interrupt preparation. */
_tx_thread_context_save();
/* Call the real ISR routine */
_sample_linux_interrupt_isr();
/* Call ThreadX context restore for interrupt completion. */
_tx_thread_context_restore();
}
}
7. Revision History
For generic code revision information, please refer to the readme_threadx_generic.txt
file, which is included in your distribution. The following details the revision
information associated with this specific port of ThreadX:
09-30-2020 Initial ThreadX 6.1 version for Linux using GNU GCC tools.
Copyright(c) 1996-2020 Microsoft Corporation
https://azure.com/rtos

View File

@ -0,0 +1,451 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Initialize */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <errno.h>
#include <sys/sysinfo.h>
/* Define various Linux objects used by the ThreadX port. */
pthread_mutex_t _tx_linux_mutex;
sem_t _tx_linux_semaphore;
sem_t _tx_linux_semaphore_no_idle;
ULONG _tx_linux_global_int_disabled_flag;
struct timespec _tx_linux_time_stamp;
__thread int _tx_linux_threadx_thread = 0;
/* Define signals for linux thread. */
#define SUSPEND_SIG SIGUSR1
#define RESUME_SIG SIGUSR2
static sigset_t _tx_linux_thread_wait_mask;
static __thread int _tx_linux_thread_suspended;
static sem_t _tx_linux_thread_timer_wait;
static sem_t _tx_linux_thread_other_wait;
/* Define simulated timer interrupt. This is done inside a thread, which is
how other interrupts may be defined as well. See code below for an
example. */
pthread_t _tx_linux_timer_id;
sem_t _tx_linux_timer_semaphore;
sem_t _tx_linux_isr_semaphore;
void *_tx_linux_timer_interrupt(void *p);
void _tx_linux_thread_resume_handler(int sig);
void _tx_linux_thread_suspend_handler(int sig);
void _tx_linux_thread_suspend(pthread_t thread_id);
#ifdef TX_LINUX_DEBUG_ENABLE
extern ULONG _tx_thread_system_state;
extern UINT _tx_thread_preempt_disable;
extern TX_THREAD *_tx_thread_current_ptr;
extern TX_THREAD *_tx_thread_execute_ptr;
/* Define debug log in order to debug Linux issues with this port. */
typedef struct TX_LINUX_DEBUG_ENTRY_STRUCT
{
char *tx_linux_debug_entry_action;
struct timespec tx_linux_debug_entry_timestamp;
char *tx_linux_debug_entry_file;
unsigned long tx_linux_debug_entry_line;
pthread_mutex_t tx_linux_debug_entry_mutex;
unsigned long tx_linux_debug_entry_int_disabled_flag;
ULONG tx_linux_debug_entry_system_state;
UINT tx_linux_debug_entry_preempt_disable;
TX_THREAD *tx_linux_debug_entry_current_thread;
TX_THREAD *tx_linux_debug_entry_execute_thread;
} TX_LINUX_DEBUG_ENTRY;
/* Define the maximum size of the Linux debug array. */
#ifndef TX_LINUX_DEBUG_EVENT_SIZE
#define TX_LINUX_DEBUG_EVENT_SIZE 400
#endif
/* Define the circular array of Linux debug entries. */
TX_LINUX_DEBUG_ENTRY _tx_linux_debug_entry_array[TX_LINUX_DEBUG_EVENT_SIZE];
/* Define the Linux debug index. */
unsigned long _tx_linux_debug_entry_index = 0;
/* Now define the debug entry function. */
void _tx_linux_debug_entry_insert(char *action, char *file, unsigned long line)
{
pthread_mutex_t temp_copy;
/* Save the current critical section value. */
temp_copy = _tx_linux_mutex;
/* Lock mutex. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Get the time stamp. */
clock_gettime(CLOCK_REALTIME, &_tx_linux_time_stamp);
/* Setup the debub entry. */
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_action = action;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_timestamp = _tx_linux_time_stamp;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_file = file;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_line = line;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_mutex = temp_copy;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_int_disabled_flag = _tx_linux_global_int_disabled_flag;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_system_state = _tx_thread_system_state;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_preempt_disable = _tx_thread_preempt_disable;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_current_thread = _tx_thread_current_ptr;
_tx_linux_debug_entry_array[_tx_linux_debug_entry_index].tx_linux_debug_entry_execute_thread = _tx_thread_execute_ptr;
/* Now move to the next entry. */
_tx_linux_debug_entry_index++;
/* Determine if we need to wrap the list. */
if (_tx_linux_debug_entry_index >= TX_LINUX_DEBUG_EVENT_SIZE)
{
/* Yes, wrap the list! */
_tx_linux_debug_entry_index = 0;
}
/* Unlock mutex. */
tx_linux_mutex_unlock(_tx_linux_mutex);
}
#endif
/* Define the ThreadX timer interrupt handler. */
void _tx_timer_interrupt(void);
/* Define other external function references. */
VOID _tx_initialize_low_level(VOID);
VOID _tx_thread_context_save(VOID);
VOID _tx_thread_context_restore(VOID);
/* Define other external variable references. */
extern VOID *_tx_initialize_unused_memory;
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_initialize_low_level Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for any low-level processor */
/* initialization, including setting up interrupt vectors, setting */
/* up a periodic timer interrupt source, saving the system stack */
/* pointer for use in ISR processing later, and finding the first */
/* available RAM memory address for tx_application_define. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* sched_setaffinity */
/* getpid */
/* _tx_linux_thread_init */
/* pthread_setschedparam */
/* pthread_mutexattr_init */
/* pthread_mutex_init */
/* _tx_linux_thread_suspend */
/* sem_init */
/* pthread_create */
/* printf */
/* */
/* CALLED BY */
/* */
/* _tx_initialize_kernel_enter ThreadX entry function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_initialize_low_level(VOID)
{
struct sched_param sp;
pthread_mutexattr_t attr;
#ifdef TX_LINUX_MULTI_CORE
cpu_set_t mask;
sched_getaffinity(getpid(), sizeof(mask), &mask);
if (CPU_COUNT(&mask) > 1)
{
srand((ULONG)pthread_self());
/* Limit this ThreadX simulation on Linux to a single core. */
CPU_ZERO(&mask);
CPU_SET(rand() % get_nprocs(), &mask);
if (sched_setaffinity(getpid(), sizeof(mask), &mask) != 0)
{
/* Error restricting the process to one core. */
printf("ThreadX Linux error restricting the process to one core!\n");
while(1)
{
}
}
}
#endif
/* Pickup the first available memory address. */
/* Save the first available memory address. */
_tx_initialize_unused_memory = malloc(TX_LINUX_MEMORY_SIZE);
/* Init Linux thread. */
_tx_linux_thread_init();
/* Set priority and schedual of main thread. */
sp.sched_priority = TX_LINUX_PRIORITY_SCHEDULE;
pthread_setschedparam(pthread_self(), SCHED_FIFO, &sp);
/* Create the system critical section. This is used by the
scheduler thread (which is the main thread) to block all
other stuff out. */
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&_tx_linux_mutex, &attr);
sem_init(&_tx_linux_semaphore, 0, 0);
#ifdef TX_LINUX_NO_IDLE_ENABLE
sem_init(&_tx_linux_semaphore_no_idle, 0, 0);
#endif /* TX_LINUX_NO_IDLE_ENABLE */
/* Initialize the global interrupt disabled flag. */
_tx_linux_global_int_disabled_flag = TX_FALSE;
/* Create semaphore for timer thread. */
sem_init(&_tx_linux_timer_semaphore, 0, 0);
/* Create semaphore for ISR thread. */
sem_init(&_tx_linux_isr_semaphore, 0, 0);
/* Setup periodic timer interrupt. */
if(pthread_create(&_tx_linux_timer_id, NULL, _tx_linux_timer_interrupt, NULL))
{
/* Error creating the timer interrupt. */
printf("ThreadX Linux error creating timer interrupt thread!\n");
while(1)
{
}
}
/* Otherwise, we have a good thread create. Now set the priority to
a level lower than the system thread but higher than the application
threads. */
sp.sched_priority = TX_LINUX_PRIORITY_ISR;
pthread_setschedparam(_tx_linux_timer_id, SCHED_FIFO, &sp);
/* Done, return to caller. */
}
/* This routine is called after initialization is complete in order to start
all interrupt threads. Interrupt threads in addition to the timer may
be added to this routine as well. */
void _tx_initialize_start_interrupts(void)
{
/* Kick the timer thread off to generate the ThreadX periodic interrupt
source. */
tx_linux_sem_post(&_tx_linux_timer_semaphore);
}
/* Define the ThreadX system timer interrupt. Other interrupts may be simulated
in a similar way. */
void *_tx_linux_timer_interrupt(void *p)
{
struct timespec ts;
long timer_periodic_nsec;
int err;
(VOID)p;
/* Calculate periodic timer. */
timer_periodic_nsec = 1000000000 / TX_TIMER_TICKS_PER_SECOND;
nice(10);
/* Wait startup semaphore. */
tx_linux_sem_wait(&_tx_linux_timer_semaphore);
while(1)
{
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_nsec += timer_periodic_nsec;
if (ts.tv_nsec > 1000000000)
{
ts.tv_nsec -= 1000000000;
ts.tv_sec++;
}
do
{
if (sem_timedwait(&_tx_linux_timer_semaphore, &ts) == 0)
{
break;
}
err = errno;
} while (err != ETIMEDOUT);
/* Call ThreadX context save for interrupt preparation. */
_tx_thread_context_save();
/* Call trace ISR enter event insert. */
_tx_trace_isr_enter_insert(0);
/* Call the ThreadX system timer interrupt processing. */
_tx_timer_interrupt();
/* Call trace ISR exit event insert. */
_tx_trace_isr_exit_insert(0);
/* Call ThreadX context restore for interrupt completion. */
_tx_thread_context_restore();
#ifdef TX_LINUX_NO_IDLE_ENABLE
tx_linux_mutex_lock(_tx_linux_mutex);
/* Make sure semaphore is 0. */
while(!sem_trywait(&_tx_linux_semaphore_no_idle));
/* Wakeup the system thread by setting the system semaphore. */
tx_linux_sem_post(&_tx_linux_semaphore_no_idle);
tx_linux_mutex_unlock(_tx_linux_mutex);
#endif /* TX_LINUX_NO_IDLE_ENABLE */
}
}
/* Define functions for linux thread. */
void _tx_linux_thread_resume_handler(int sig)
{
(VOID)sig;
}
void _tx_linux_thread_suspend_handler(int sig)
{
(VOID)sig;
if(pthread_equal(pthread_self(), _tx_linux_timer_id))
tx_linux_sem_post_nolock(&_tx_linux_thread_timer_wait);
else
tx_linux_sem_post_nolock(&_tx_linux_thread_other_wait);
if(_tx_linux_thread_suspended)
return;
_tx_linux_thread_suspended = 1;
sigsuspend(&_tx_linux_thread_wait_mask);
_tx_linux_thread_suspended = 0;
}
void _tx_linux_thread_suspend(pthread_t thread_id)
{
/* Send signal. */
tx_linux_mutex_lock(_tx_linux_mutex);
pthread_kill(thread_id, SUSPEND_SIG);
tx_linux_mutex_unlock(_tx_linux_mutex);
/* Wait until signal is received. */
if(pthread_equal(thread_id, _tx_linux_timer_id))
tx_linux_sem_wait(&_tx_linux_thread_timer_wait);
else
tx_linux_sem_wait(&_tx_linux_thread_other_wait);
}
void _tx_linux_thread_resume(pthread_t thread_id)
{
/* Send signal. */
tx_linux_mutex_lock(_tx_linux_mutex);
pthread_kill(thread_id, RESUME_SIG);
tx_linux_mutex_unlock(_tx_linux_mutex);
}
void _tx_linux_thread_init()
{
struct sigaction sa;
/* Create semaphore for linux thread. */
sem_init(&_tx_linux_thread_timer_wait, 0, 0);
sem_init(&_tx_linux_thread_other_wait, 0, 0);
sigfillset(&_tx_linux_thread_wait_mask);
sigdelset(&_tx_linux_thread_wait_mask, RESUME_SIG);
sigfillset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = _tx_linux_thread_resume_handler;
sigaction(RESUME_SIG, &sa, NULL);
sa.sa_handler = _tx_linux_thread_suspend_handler;
sigaction(SUSPEND_SIG, &sa, NULL);
}

View File

@ -0,0 +1,163 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
extern sem_t _tx_linux_isr_semaphore;
UINT _tx_linux_timer_waiting = 0;
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_context_restore Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function restores the interrupt context if it is processing a */
/* nested interrupt. If not, it returns to the interrupt thread if no */
/* preemption is necessary. Otherwise, if preemption is necessary or */
/* if no thread was running, the function returns to the scheduler. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_linux_debug_entry_insert */
/* tx_linux_mutex_lock */
/* sem_trywait */
/* tx_linux_sem_post */
/* tx_linux_sem_wait */
/* _tx_linux_thread_resume */
/* tx_linux_mutex_recursive_unlock */
/* */
/* CALLED BY */
/* */
/* ISRs Interrupt Service Routines */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_context_restore(VOID)
{
/* Debug entry. */
_tx_linux_debug_entry_insert("CONTEXT_RESTORE", __FILE__, __LINE__);
/* Lock mutex to ensure other threads are not playing with
the core ThreadX data structures. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Decrement the nested interrupt count. */
_tx_thread_system_state--;
/* Determine if this is the first nested interrupt and if a ThreadX
application thread was running at the time. */
if ((!_tx_thread_system_state) && (_tx_thread_current_ptr))
{
/* Yes, this is the first and last interrupt processed. */
/* Check to see if preemption is required. */
if ((_tx_thread_preempt_disable == 0) && (_tx_thread_current_ptr != _tx_thread_execute_ptr))
{
/* Preempt the running application thread. We don't need to suspend the
application thread since that is done in the context save processing. */
/* Indicate that this thread was suspended asynchronously. */
_tx_thread_current_ptr -> tx_thread_linux_suspension_type = 1;
/* Save the remaining time-slice and disable it. */
if (_tx_timer_time_slice)
{
_tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
_tx_timer_time_slice = 0;
}
/* Clear the current thread pointer. */
_tx_thread_current_ptr = TX_NULL;
/* Make sure semaphore is 0. */
while(!sem_trywait(&_tx_linux_semaphore));
/* Indicate it is in timer ISR. */
_tx_linux_timer_waiting = 1;
/* Wakeup the system thread by setting the system semaphore. */
tx_linux_sem_post(&_tx_linux_semaphore);
if(_tx_thread_execute_ptr)
{
if(_tx_thread_execute_ptr -> tx_thread_linux_suspension_type == 0)
{
/* Unlock linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
/* Wait until TX_THREAD start running. */
tx_linux_sem_wait(&_tx_linux_isr_semaphore);
tx_linux_mutex_lock(_tx_linux_mutex);
/* Make sure semaphore is 0. */
while(!sem_trywait(&_tx_linux_isr_semaphore));
}
}
/* Indicate it is not in timer ISR. */
_tx_linux_timer_waiting = 0;
}
else
{
/* Since preemption is not required, resume the interrupted thread. */
_tx_linux_thread_resume(_tx_thread_current_ptr -> tx_thread_linux_thread_id);
}
}
/* Unlock linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
}

View File

@ -0,0 +1,107 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_context_save Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function saves the context of an executing thread in the */
/* beginning of interrupt processing. The function also ensures that */
/* the system stack is used upon return to the calling ISR. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_linux_debug_entry_insert */
/* tx_linux_mutex_lock */
/* _tx_linux_thread_suspend */
/* tx_linux_mutex_unlock */
/* */
/* CALLED BY */
/* */
/* ISRs */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_context_save(VOID)
{
/* Debug entry. */
_tx_linux_debug_entry_insert("CONTEXT_SAVE", __FILE__, __LINE__);
/* Lock mutex to ensure other threads are not playing with
the core ThreadX data structures. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* If an application thread is running, suspend it to simulate preemption. */
if ((_tx_thread_current_ptr) && (_tx_thread_system_state == 0))
{
/* Debug entry. */
_tx_linux_debug_entry_insert("CONTEXT_SAVE-suspend_thread", __FILE__, __LINE__);
/* Yes, this is the first interrupt and an application thread is running...
suspend it! */
_tx_linux_thread_suspend(_tx_thread_current_ptr -> tx_thread_linux_thread_id);
/* Indicate that this thread was suspended asynchronously. */
_tx_thread_current_ptr -> tx_thread_linux_suspension_type = 1;
}
/* Increment the nested interrupt condition. */
_tx_thread_system_state++;
/* Unlock linux mutex. */
tx_linux_mutex_unlock(_tx_linux_mutex);
}

View File

@ -0,0 +1,183 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
/* Define small routines used for the TX_DISABLE/TX_RESTORE macros. */
UINT _tx_thread_interrupt_disable(void)
{
UINT previous_value;
previous_value = _tx_thread_interrupt_control(TX_INT_DISABLE);
return(previous_value);
}
VOID _tx_thread_interrupt_restore(UINT previous_posture)
{
previous_posture = _tx_thread_interrupt_control(previous_posture);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_interrupt_control Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for changing the interrupt lockout */
/* posture of the system. */
/* */
/* INPUT */
/* */
/* new_posture New interrupt lockout posture */
/* */
/* OUTPUT */
/* */
/* old_posture Old interrupt lockout posture */
/* */
/* CALLS */
/* */
/* tx_linux_mutex_lock */
/* pthread_self */
/* pthread_getschedparam */
/* tx_linux_mutex_recursive_unlock */
/* pthread_exit */
/* */
/* CALLED BY */
/* */
/* Application Code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _tx_thread_interrupt_control(UINT new_posture)
{
UINT old_posture;
TX_THREAD *thread_ptr;
pthread_t thread_id;
int exit_code = 0;
/* Lock Linux mutex. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Pickup the id of the current thread. */
thread_id = pthread_self();
/* Pickup the current thread pointer. */
thread_ptr = _tx_thread_current_ptr;
/* Determine if this is a thread and it does not
match the current thread pointer. */
if ((_tx_linux_threadx_thread) &&
((!thread_ptr) || (!pthread_equal(thread_ptr -> tx_thread_linux_thread_id, thread_id))))
{
/* This indicates the Linux thread was actually terminated by ThreadX is only
being allowed to run in order to cleanup its resources. */
/* Unlock linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
pthread_exit((void *)&exit_code);
}
/* Determine the current interrupt lockout condition. */
if (tx_linux_mutex_recursive_count == 1)
{
/* Interrupts are enabled. */
old_posture = TX_INT_ENABLE;
}
else
{
/* Interrupts are disabled. */
old_posture = TX_INT_DISABLE;
}
/* First, determine if this call is from a non-thread. */
if (_tx_thread_system_state)
{
/* Determine how to apply the new posture. */
if (new_posture == TX_INT_ENABLE)
{
/* Clear the disabled flag. */
_tx_linux_global_int_disabled_flag = TX_FALSE;
/* Determine if the critical section is locked. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
}
else if (new_posture == TX_INT_DISABLE)
{
/* Set the disabled flag. */
_tx_linux_global_int_disabled_flag = TX_TRUE;
}
}
else if (thread_ptr)
{
/* Determine how to apply the new posture. */
if (new_posture == TX_INT_ENABLE)
{
/* Clear the disabled flag. */
_tx_thread_current_ptr -> tx_thread_linux_int_disabled_flag = TX_FALSE;
/* Determine if the critical section is locked. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
}
else if (new_posture == TX_INT_DISABLE)
{
/* Set the disabled flag. */
_tx_thread_current_ptr -> tx_thread_linux_int_disabled_flag = TX_TRUE;
}
}
/* Return the previous interrupt disable posture. */
return(old_posture);
}

View File

@ -0,0 +1,264 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
#include <stdio.h>
#include <errno.h>
extern sem_t _tx_linux_timer_semaphore;
extern sem_t _tx_linux_isr_semaphore;
extern UINT _tx_linux_timer_waiting;
extern pthread_t _tx_linux_timer_id;
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_schedule Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function waits for a thread control block pointer to appear in */
/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
/* in the variable, the corresponding thread is resumed. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* tx_linux_mutex_lock */
/* tx_linux_mutex_unlock */
/* _tx_linux_debug_entry_insert */
/* _tx_linux_thread_resume */
/* tx_linux_sem_post */
/* sem_trywait */
/* tx_linux_sem_wait */
/* */
/* CALLED BY */
/* */
/* _tx_initialize_kernel_enter ThreadX entry function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_schedule(VOID)
{
struct timespec ts;
/* Set timer. */
ts.tv_sec = 0;
ts.tv_nsec = 200000;
/* Loop forever. */
while(1)
{
/* Wait for a thread to execute and all ISRs to complete. */
while(1)
{
/* Lock Linux mutex. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Determine if there is a thread ready to execute AND all ISRs
are complete. */
if ((_tx_thread_execute_ptr != TX_NULL) && (_tx_thread_system_state == 0))
{
/* Get out of this loop and schedule the thread! */
break;
}
else
{
/* Unlock linux mutex. */
tx_linux_mutex_unlock(_tx_linux_mutex);
/* Don't waste all the processor time here in the master thread... */
#ifdef TX_LINUX_NO_IDLE_ENABLE
while(!sem_trywait(&_tx_linux_timer_semaphore));
tx_linux_sem_post(&_tx_linux_timer_semaphore);
/*nanosleep(&ts, &ts);*/
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_nsec += 200000;
if (ts.tv_nsec > 1000000000)
{
ts.tv_nsec -= 1000000000;
ts.tv_sec++;
}
sem_timedwait(&_tx_linux_semaphore_no_idle, &ts);
#else
nanosleep(&ts, &ts);
#endif /* TX_LINUX_NO_IDLE_ENABLE */
}
}
/* Yes! We have a thread to execute. Note that the critical section is already
active from the scheduling loop above. */
/* Setup the current thread pointer. */
_tx_thread_current_ptr = _tx_thread_execute_ptr;
/* Increment the run count for this thread. */
_tx_thread_current_ptr -> tx_thread_run_count++;
/* Setup time-slice, if present. */
_tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice;
/* Determine how the thread was suspended. */
if (_tx_thread_current_ptr -> tx_thread_linux_suspension_type)
{
/* Debug entry. */
_tx_linux_debug_entry_insert("SCHEDULE-resume_thread", __FILE__, __LINE__);
/* Pseudo interrupt suspension. The thread is not waiting on
its run semaphore. */
_tx_linux_thread_resume(_tx_thread_current_ptr -> tx_thread_linux_thread_id);
}
else
{
/* Debug entry. */
_tx_linux_debug_entry_insert("SCHEDULE-release_sem", __FILE__, __LINE__);
/* Make sure semaphore is 0. */
while(!sem_trywait(&_tx_thread_current_ptr -> tx_thread_linux_thread_run_semaphore));
/* Let the thread run again by releasing its run semaphore. */
tx_linux_sem_post(&_tx_thread_current_ptr -> tx_thread_linux_thread_run_semaphore);
/* Block timer ISR. */
if(_tx_linux_timer_waiting)
{
/* It is woken up by timer ISR. */
/* Let ThreadX thread wake up first. */
tx_linux_sem_wait(&_tx_linux_semaphore);
/* Wake up timer ISR. */
tx_linux_sem_post_nolock(&_tx_linux_isr_semaphore);
}
else
{
/* It is woken up by TX_THREAD. */
/* Suspend timer thread and let ThreadX thread wake up first. */
_tx_linux_thread_suspend(_tx_linux_timer_id);
tx_linux_sem_wait(&_tx_linux_semaphore);
_tx_linux_thread_resume(_tx_linux_timer_id);
}
}
/* Unlock linux mutex. */
tx_linux_mutex_unlock(_tx_linux_mutex);
/* Debug entry. */
_tx_linux_debug_entry_insert("SCHEDULE-self_suspend_sem", __FILE__, __LINE__);
/* Now suspend the main thread so the application thread can run. */
tx_linux_sem_wait(&_tx_linux_semaphore);
/* Debug entry. */
_tx_linux_debug_entry_insert("SCHEDULE-wake_up", __FILE__, __LINE__);
}
}
void _tx_thread_delete_port_completion(TX_THREAD *thread_ptr, UINT tx_saved_posture)
{
INT linux_status;
sem_t *threadrunsemaphore;
pthread_t thread_id;
struct timespec ts;
thread_id = thread_ptr -> tx_thread_linux_thread_id;
threadrunsemaphore = &(thread_ptr -> tx_thread_linux_thread_run_semaphore);
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
TX_RESTORE
do
{
linux_status = pthread_cancel(thread_id);
if(linux_status != EAGAIN)
{
break;
}
_tx_linux_thread_resume(thread_id);
tx_linux_sem_post(threadrunsemaphore);
nanosleep(&ts, &ts);
} while (1);
pthread_join(thread_id, NULL);
sem_destroy(threadrunsemaphore);
TX_DISABLE
}
void _tx_thread_reset_port_completion(TX_THREAD *thread_ptr, UINT tx_saved_posture)
{
INT linux_status;
sem_t *threadrunsemaphore;
pthread_t thread_id;
struct timespec ts;
thread_id = thread_ptr -> tx_thread_linux_thread_id;
threadrunsemaphore = &(thread_ptr -> tx_thread_linux_thread_run_semaphore);
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
TX_RESTORE
do
{
linux_status = pthread_cancel(thread_id);
if(linux_status != EAGAIN)
{
break;
}
_tx_linux_thread_resume(thread_id);
tx_linux_sem_post(threadrunsemaphore);
nanosleep(&ts, &ts);
} while (1);
pthread_join(thread_id, NULL);
sem_destroy(threadrunsemaphore);
TX_DISABLE
}

View File

@ -0,0 +1,155 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include <stdio.h>
#include <unistd.h>
/* Prototype for new thread entry function. */
void *_tx_linux_thread_entry(void *ptr);
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_stack_build Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function builds a stack frame on the supplied thread's stack. */
/* The stack frame results in a fake interrupt return to the supplied */
/* function pointer. */
/* */
/* INPUT */
/* */
/* thread_ptr Pointer to thread control blk */
/* function_ptr Pointer to return function */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* pthread_create */
/* pthread_setschedparam */
/* _tx_linux_thread_suspend */
/* sem_init */
/* printf */
/* _tx_linux_thread_resume */
/* */
/* CALLED BY */
/* */
/* _tx_thread_create Create thread service */
/* _tx_thread_reset Reset thread service */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
{
struct sched_param sp;
(VOID)function_ptr;
/* Create the run semaphore for the thread. This will allow the scheduler
control over when the thread actually runs. */
if(sem_init(&thread_ptr -> tx_thread_linux_thread_run_semaphore, 0, 0))
{
/* Display an error message. */
printf("ThreadX Linux error creating thread running semaphore!\n");
while(1)
{
}
}
/* Create a Linux thread for the application thread. */
if(pthread_create(&thread_ptr -> tx_thread_linux_thread_id, NULL, _tx_linux_thread_entry, thread_ptr))
{
/* Display an error message. */
printf("ThreadX Linux error creating thread!\n");
while(1)
{
}
}
/* Otherwise, we have a good thread create. */
sp.sched_priority = TX_LINUX_PRIORITY_USER_THREAD;
pthread_setschedparam(thread_ptr -> tx_thread_linux_thread_id, SCHED_FIFO, &sp);
/* Setup the thread suspension type to solicited thread suspension.
Pseudo interrupt handlers will suspend with this field set to 1. */
thread_ptr -> tx_thread_linux_suspension_type = 0;
/* Clear the disabled count that will keep track of the
tx_interrupt_control nesting. */
thread_ptr -> tx_thread_linux_int_disabled_flag = 0;
/* Setup a fake thread stack pointer. */
thread_ptr -> tx_thread_stack_ptr = (VOID *) (((CHAR *) thread_ptr -> tx_thread_stack_end) - 8);
/* Clear the first word of the stack. */
*(((ULONG *) thread_ptr -> tx_thread_stack_ptr) - 1) = 0;
}
void *_tx_linux_thread_entry(void *ptr)
{
TX_THREAD *thread_ptr;
/* Pickup the current thread pointer. */
thread_ptr = (TX_THREAD *) ptr;
_tx_linux_threadx_thread = 1;
nice(20);
/* Now suspend the thread initially. If the thread has already
been scheduled, this will return immediately. */
tx_linux_sem_wait(&thread_ptr -> tx_thread_linux_thread_run_semaphore);
tx_linux_sem_post_nolock(&_tx_linux_semaphore);
/* Call ThreadX thread entry point. */
_tx_thread_shell_entry();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,207 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
#include <stdio.h>
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_system_return Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is target processor specific. It is used to transfer */
/* control from a thread back to the system. Only a minimal context */
/* is saved since the compiler assumes temp registers are going to get */
/* slicked by a function call anyway. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_linux_debug_entry_insert */
/* tx_linux_mutex_lock */
/* pthread_self */
/* pthread_getschedparam */
/* pthread_equal */
/* tx_linux_mutex_recursive_unlock */
/* tx_linux_mutex_unlock */
/* pthread_exit */
/* tx_linux_sem_post */
/* sem_trywait */
/* tx_linux_sem_wait */
/* */
/* CALLED BY */
/* */
/* ThreadX components */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_system_return(VOID)
{
TX_THREAD *temp_thread_ptr;
sem_t *temp_run_semaphore;
UINT temp_thread_state;
pthread_t thread_id;
int exit_code = 0;
/* Debug entry. */
_tx_linux_debug_entry_insert("SYSTEM_RETURN", __FILE__, __LINE__);
/* Lock Linux mutex. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* First, determine if the thread was terminated. */
/* Pickup the id of the current thread. */
thread_id = pthread_self();
/* Pickup the current thread pointer. */
temp_thread_ptr = _tx_thread_current_ptr;
/* Determine if this is a thread (0) and it does not
match the current thread pointer. */
if ((_tx_linux_threadx_thread) &&
((!temp_thread_ptr) || (!pthread_equal(temp_thread_ptr -> tx_thread_linux_thread_id, thread_id))))
{
/* This indicates the Linux thread was actually terminated by ThreadX is only
being allowed to run in order to cleanup its resources. */
/* Unlock linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
pthread_exit((void *)&exit_code);
}
/* Determine if the time-slice is active. */
if (_tx_timer_time_slice)
{
/* Preserve current remaining time-slice for the thread and clear the current time-slice. */
temp_thread_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
_tx_timer_time_slice = 0;
}
/* Save the run semaphore into a temporary variable as well. */
temp_run_semaphore = &temp_thread_ptr -> tx_thread_linux_thread_run_semaphore;
/* Pickup the current thread state. */
temp_thread_state = temp_thread_ptr -> tx_thread_state;
/* Setup the suspension type for this thread. */
temp_thread_ptr -> tx_thread_linux_suspension_type = 0;
/* Set the current thread pointer to NULL. */
_tx_thread_current_ptr = TX_NULL;
/* Unlock Linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
/* Debug entry. */
_tx_linux_debug_entry_insert("SYSTEM_RETURN-release_sem", __FILE__, __LINE__);
/* Make sure semaphore is 0. */
while(!sem_trywait(&_tx_linux_semaphore));
/* Release the semaphore that the main scheduling thread is waiting
on. Note that the main scheduling algorithm will take care of
setting the current thread pointer to NULL. */
tx_linux_sem_post(&_tx_linux_semaphore);
/* Determine if the thread was self-terminating. */
if (temp_thread_state == TX_TERMINATED)
{
/* Exit the thread instead of waiting on the semaphore! */
pthread_exit((void *)&exit_code);
}
/* Wait on the run semaphore for this thread. This won't get set again
until the thread is scheduled. */
tx_linux_sem_wait(temp_run_semaphore);
tx_linux_sem_post_nolock(&_tx_linux_semaphore);
/* Lock Linux mutex. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Debug entry. */
_tx_linux_debug_entry_insert("SYSTEM_RETURN-wake_up", __FILE__, __LINE__);
/* Determine if the thread was terminated. */
/* Pickup the current thread pointer. */
temp_thread_ptr = _tx_thread_current_ptr;
/* Determine if this is a thread and it does not
match the current thread pointer. */
if ((_tx_linux_threadx_thread) &&
((!temp_thread_ptr) || (!pthread_equal(temp_thread_ptr -> tx_thread_linux_thread_id, thread_id))))
{
/* Unlock Linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
/* This indicates the Linux thread was actually terminated by ThreadX and is only
being allowed to run in order to cleanup its resources. */
pthread_exit((void *)&exit_code);
}
/* Now determine if the application thread last had interrupts disabled. */
/* Determine if this thread had interrupts disabled. */
if (!_tx_thread_current_ptr -> tx_thread_linux_int_disabled_flag)
{
/* Unlock Linux mutex. */
tx_linux_mutex_recursive_unlock(_tx_linux_mutex);
}
/* Debug entry. */
_tx_linux_debug_entry_insert("SYSTEM_RETURN-finish", __FILE__, __LINE__);
}

View File

@ -0,0 +1,154 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Timer */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_timer.h"
#include "tx_thread.h"
VOID _tx_timer_interrupt(VOID);
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_timer_interrupt Linux/GNU */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the hardware timer interrupt. This */
/* processing includes incrementing the system clock and checking for */
/* time slice and/or timer expiration. If either is found, the */
/* interrupt context save/restore functions are called along with the */
/* expiration functions. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_linux_debug_entry_insert */
/* tx_linux_mutex_lock */
/* tx_linux_mutex_unlock */
/* _tx_timer_expiration_process */
/* _tx_thread_time_slice */
/* */
/* CALLED BY */
/* */
/* interrupt vector */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_timer_interrupt(VOID)
{
/* Debug entry. */
_tx_linux_debug_entry_insert("TIMER INTERRUPT", __FILE__, __LINE__);
/* Lock mutex to ensure other threads are not playing with
the core ThreadX data structures. */
tx_linux_mutex_lock(_tx_linux_mutex);
/* Increment the system clock. */
_tx_timer_system_clock++;
/* Test for time-slice expiration. */
if (_tx_timer_time_slice)
{
/* Decrement the time_slice. */
_tx_timer_time_slice--;
/* Check for expiration. */
if (_tx_timer_time_slice == 0)
{
/* Set the time-slice expired flag. */
_tx_timer_expired_time_slice = TX_TRUE;
}
}
/* Test for timer expiration. */
if (*_tx_timer_current_ptr)
{
/* Set expiration flag. */
_tx_timer_expired = TX_TRUE;
}
else
{
/* No timer expired, increment the timer pointer. */
_tx_timer_current_ptr++;
/* Check for wrap-around. */
if (_tx_timer_current_ptr == _tx_timer_list_end)
{
/* Wrap to beginning of list. */
_tx_timer_current_ptr = _tx_timer_list_start;
}
}
/* See if anything has expired. */
if ((_tx_timer_expired_time_slice) || (_tx_timer_expired))
{
/* Did a timer expire? */
if (_tx_timer_expired)
{
/* Process timer expiration. */
_tx_timer_expiration_process();
}
/* Did time slice expire? */
if (_tx_timer_expired_time_slice)
{
/* Time slice interrupted thread. */
_tx_thread_time_slice();
}
}
/* Unlock linux mutex. */
tx_linux_mutex_unlock(_tx_linux_mutex);
}

View File

@ -0,0 +1,20 @@
target_sources(${PROJECT_NAME}
PRIVATE
# {{BEGIN_TARGET_SOURCES}}
${CMAKE_CURRENT_LIST_DIR}/src/tx_initialize_low_level.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_restore.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_save.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_control.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_schedule.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_build.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_return.c
${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_interrupt.c
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)

View File

@ -0,0 +1,46 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30204.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_threadx", "sample_threadx\sample_threadx.vcxproj", "{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tx", "tx\tx.vcxproj", "{51907112-62DA-98D6-7897-5A2FD48B99C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Template|Win32 = Template|Win32
Template|x64 = Template|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Debug|Win32.ActiveCfg = Debug|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Debug|Win32.Build.0 = Debug|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Debug|x64.ActiveCfg = Debug|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Release|Win32.ActiveCfg = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Release|Win32.Build.0 = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Release|x64.ActiveCfg = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Template|Win32.ActiveCfg = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Template|Win32.Build.0 = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Template|x64.ActiveCfg = Release|Win32
{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}.Template|x64.Build.0 = Release|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Debug|Win32.ActiveCfg = Debug|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Debug|Win32.Build.0 = Debug|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Debug|x64.ActiveCfg = Debug|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Release|Win32.ActiveCfg = Release|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Release|Win32.Build.0 = Release|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Release|x64.ActiveCfg = Release|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Template|Win32.ActiveCfg = Template|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Template|Win32.Build.0 = Template|Win32
{51907112-62DA-98D6-7897-5A2FD48B99C3}.Template|x64.ActiveCfg = Template|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FAE0BBF6-14F8-4320-AAB9-65E1361EB38A}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,381 @@
/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight
threads of different priorities, using a message queue, semaphore, mutex, event flags group,
byte pool, and block pool. */
#include "tx_api.h"
#include <stdio.h>
#define DEMO_STACK_SIZE 1024
#define DEMO_BYTE_POOL_SIZE 9120
#define DEMO_BLOCK_POOL_SIZE 100
#define DEMO_QUEUE_SIZE 100
/* Define the ThreadX object control blocks... */
TX_THREAD thread_0;
TX_THREAD thread_1;
TX_THREAD thread_2;
TX_THREAD thread_3;
TX_THREAD thread_4;
TX_THREAD thread_5;
TX_THREAD thread_6;
TX_THREAD thread_7;
TX_QUEUE queue_0;
TX_SEMAPHORE semaphore_0;
TX_MUTEX mutex_0;
TX_EVENT_FLAGS_GROUP event_flags_0;
TX_BYTE_POOL byte_pool_0;
TX_BLOCK_POOL block_pool_0;
/* Define the counters used in the demo application... */
ULONG thread_0_counter;
ULONG thread_1_counter;
ULONG thread_1_messages_sent;
ULONG thread_2_counter;
ULONG thread_2_messages_received;
ULONG thread_3_counter;
ULONG thread_4_counter;
ULONG thread_5_counter;
ULONG thread_6_counter;
ULONG thread_7_counter;
/* Define thread prototypes. */
void thread_0_entry(ULONG thread_input);
void thread_1_entry(ULONG thread_input);
void thread_2_entry(ULONG thread_input);
void thread_3_and_4_entry(ULONG thread_input);
void thread_5_entry(ULONG thread_input);
void thread_6_and_7_entry(ULONG thread_input);
/* Define main entry point. */
int main()
{
/* Enter the ThreadX kernel. */
tx_kernel_enter();
}
/* Define what the initial system looks like. */
void tx_application_define(void *first_unused_memory)
{
CHAR *pointer = TX_NULL;
/* Create a byte memory pool from which to allocate the thread stacks. */
tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE);
/* Put system definition stuff in here, e.g. thread creates and other assorted
create information. */
/* Allocate the stack for thread 0. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create the main thread. */
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, DEMO_STACK_SIZE,
1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 1. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 1 and 2. These threads pass information through a ThreadX
message queue. It is also interesting to note that these threads have a time
slice. */
tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 2. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 3. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore.
An interesting thing here is that both threads share the same instruction area. */
tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 4. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 5. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create thread 5. This thread simply pends on an event flag which will be set
by thread_0. */
tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, DEMO_STACK_SIZE,
4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 6. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 6 and 7. These threads compete for a ThreadX mutex. */
tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 7. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the message queue. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT);
/* Create the message queue shared by threads 1 and 2. */
tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG));
/* Create the semaphore used by threads 3 and 4. */
tx_semaphore_create(&semaphore_0, "semaphore 0", 1);
/* Create the event flags group used by threads 1 and 5. */
tx_event_flags_create(&event_flags_0, "event flags 0");
/* Create the mutex used by thread 6 and 7 without priority inheritance. */
tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT);
/* Allocate the memory for a small block pool. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT);
/* Create a block memory pool to allocate a message buffer from. */
tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE);
/* Allocate a block and release the block memory. */
tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT);
/* Release the block back to the pool. */
tx_block_release(pointer);
}
/* Define the test threads. */
void thread_0_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sits in while-forever-sleep loop. */
while(1)
{
/* Increment the thread counter. */
thread_0_counter++;
/* Print results. */
printf("**** ThreadX Win32 Demonstration **** (c) 1996-2020 Microsoft Corporation\n\n");
printf(" thread 0 events sent: %lu\n", thread_0_counter);
printf(" thread 1 messages sent: %lu\n", thread_1_counter);
printf(" thread 2 messages received: %lu\n", thread_2_counter);
printf(" thread 3 obtained semaphore: %lu\n", thread_3_counter);
printf(" thread 4 obtained semaphore: %lu\n", thread_4_counter);
printf(" thread 5 events received: %lu\n", thread_5_counter);
printf(" thread 6 mutex obtained: %lu\n", thread_6_counter);
printf(" thread 7 mutex obtained: %lu\n\n", thread_7_counter);
/* Sleep for 10 ticks. */
tx_thread_sleep(10);
/* Set event flag 0 to wakeup thread 5. */
status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_1_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sends messages to a queue shared by thread 2. */
while(1)
{
/* Increment the thread counter. */
thread_1_counter++;
/* Send message to queue 0. */
status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER);
/* Check completion status. */
if (status != TX_SUCCESS)
break;
/* Increment the message sent. */
thread_1_messages_sent++;
}
}
void thread_2_entry(ULONG thread_input)
{
ULONG received_message;
UINT status;
/* This thread retrieves messages placed on the queue by thread 1. */
while(1)
{
/* Increment the thread counter. */
thread_2_counter++;
/* Retrieve a message from the queue. */
status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER);
/* Check completion status and make sure the message is what we
expected. */
if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received))
break;
/* Otherwise, all is okay. Increment the received message count. */
thread_2_messages_received++;
}
}
void thread_3_and_4_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 3 and thread 4. As the loop
below shows, these function compete for ownership of semaphore_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 3)
thread_3_counter++;
else
thread_4_counter++;
/* Get the semaphore with suspension. */
status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the semaphore. */
tx_thread_sleep(2);
/* Release the semaphore. */
status = tx_semaphore_put(&semaphore_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_5_entry(ULONG thread_input)
{
UINT status;
ULONG actual_flags;
/* This thread simply waits for an event in a forever loop. */
while(1)
{
/* Increment the thread counter. */
thread_5_counter++;
/* Wait for event flag 0. */
status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR,
&actual_flags, TX_WAIT_FOREVER);
/* Check status. */
if ((status != TX_SUCCESS) || (actual_flags != 0x1))
break;
}
}
void thread_6_and_7_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 6 and thread 7. As the loop
below shows, these function compete for ownership of mutex_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 6)
thread_6_counter++;
else
thread_7_counter++;
/* Get the mutex with suspension. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Get the mutex again with suspension. This shows
that an owning thread may retrieve the mutex it
owns multiple times. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the mutex. */
tx_thread_sleep(2);
/* Release the mutex. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Release the mutex again. This will actually
release ownership since it was obtained twice. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<SccProjectName />
<SccLocalPath />
<ProjectGuid>{7342DEEF-AB3F-00D5-9EDB-2829CD277B76}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Debug\sample_threadx.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Debug\</ObjectFileName>
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<AdditionalIncludeDirectories>..\..\inc;..\..\..\..\..\common\inc</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Midl>
<TypeLibraryName>.\Debug\sample_threadx.tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug\sample_threadx.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OutputFile>.\Debug\sample_threadx.exe</OutputFile>
<AdditionalDependencies>tx.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\tx\Debug</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>MaxSpeed</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Release\sample_threadx.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Release\</ObjectFileName>
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>..\..\inc;..\..\..\..\..\common\inc</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Midl>
<TypeLibraryName>.\Release\sample_threadx.tlb</TypeLibraryName>
</Midl>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release\sample_threadx.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Console</SubSystem>
<OutputFile>.\Release\sample_threadx.exe</OutputFile>
<AdditionalDependencies>tx.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\tx\Release</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\common\inc\tx_api.h" />
<ClInclude Include="..\..\inc\tx_port.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="sample_threadx.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="inc">
<UniqueIdentifier>{6006269e-f4d4-4e46-be11-4a87e3703f4b}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{92d04b48-db8b-4511-a4fd-305688bda3d5}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\inc\tx_port.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_api.h">
<Filter>inc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="sample_threadx.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,340 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Template|Win32">
<Configuration>Template</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\common\inc\tx_api.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_block_pool.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_byte_pool.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_event_flags.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_initialize.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_mutex.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_queue.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_semaphore.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_thread.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_timer.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_trace.h" />
<ClInclude Include="..\..\..\..\..\common\inc\tx_user.h" />
<ClInclude Include="..\..\inc\tx_port.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_allocate.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_block_release.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_allocate.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_release.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_set.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_set_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_flush.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_front_send.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_receive.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_send.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_send_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_ceiling_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_put_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_entry_exit_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_preemption_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_priority_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_relinquish.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_reset.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_resume.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_suspend.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_terminate.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_time_slice_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_wait_abort.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_activate.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_deactivate.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_allocate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_block_release.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_allocate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_search.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_release.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_set.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_set_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_high_level.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_kernel_enter.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_kernel_setup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_misra.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_priority_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_flush.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_front_send.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_receive.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_send.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_send_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_ceiling_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_cleanup.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_prioritize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_put.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_put_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_entry_exit_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_identify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_preemption_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_priority_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_relinquish.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_reset.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_resume.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_shell_entry.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_sleep.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_analyze.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_error_handler.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_error_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_suspend.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_preempt_check.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_resume.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_suspend.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_terminate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_timeout.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_time_slice.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_time_slice_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_wait_abort.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_activate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_change.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_create.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_deactivate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_delete.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_expiration_process.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_system_activate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_system_deactivate.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_thread_entry.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_time_get.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_time_set.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_buffer_full_notify.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_disable.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_enable.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_event_filter.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_event_unfilter.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_initialize.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_interrupt_control.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_isr_enter_insert.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_isr_exit_insert.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_object_register.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_object_unregister.c" />
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_user_event_insert.c" />
<ClCompile Include="..\..\src\tx_initialize_low_level.c" />
<ClCompile Include="..\..\src\tx_thread_context_restore.c" />
<ClCompile Include="..\..\src\tx_thread_context_save.c" />
<ClCompile Include="..\..\src\tx_thread_interrupt_control.c" />
<ClCompile Include="..\..\src\tx_thread_schedule.c" />
<ClCompile Include="..\..\src\tx_thread_stack_build.c" />
<ClCompile Include="..\..\src\tx_thread_system_return.c" />
<ClCompile Include="..\..\src\tx_timer_interrupt.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<SccProjectName />
<SccLocalPath />
<ProjectGuid>{51907112-62DA-98D6-7897-5A2FD48B99C3}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>MaxSpeed</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Release\tx.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Release\</ObjectFileName>
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>..\..\inc;..\..\..\..\..\common\inc</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release\tx.bsc</OutputFile>
</Bscmake>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release\tx.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>Disabled</Optimization>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Debug\tx.pch</PrecompiledHeaderOutputFile>
<ObjectFileName>.\Debug\</ObjectFileName>
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<AdditionalIncludeDirectories>..\..\inc;..\..\..\..\..\common\inc</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug\tx.bsc</OutputFile>
</Bscmake>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug\tx.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,633 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="inc">
<UniqueIdentifier>{096c4605-3053-4040-8f19-1e6fedb9568e}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{3786c84c-e250-4a5c-b0a0-2a1d2c8979e3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\inc\tx_port.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_api.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_block_pool.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_byte_pool.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_event_flags.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_initialize.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_mutex.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_queue.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_semaphore.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_thread.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_timer.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_trace.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\common\inc\tx_user.h">
<Filter>inc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\tx_thread_context_restore.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_thread_context_save.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_thread_interrupt_control.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_thread_schedule.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_thread_stack_build.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_thread_system_return.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_timer_interrupt.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_allocate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_pool_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_block_release.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_allocate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_pool_search.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_byte_release.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_set.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_event_flags_set_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_high_level.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_kernel_enter.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_initialize_kernel_setup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_misra.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_priority_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_mutex_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_flush.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_front_send.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_receive.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_send.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_queue_send_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_ceiling_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_cleanup.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_semaphore_put_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_entry_exit_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_identify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_preemption_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_priority_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_relinquish.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_reset.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_resume.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_shell_entry.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_sleep.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_analyze.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_error_handler.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_stack_error_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_suspend.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_preempt_check.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_resume.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_system_suspend.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_terminate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_time_slice.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_time_slice_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_timeout.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_thread_wait_abort.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_time_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_time_set.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_activate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_deactivate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_expiration_process.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_performance_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_performance_system_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_system_activate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_system_deactivate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_timer_thread_entry.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_buffer_full_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_disable.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_enable.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_event_filter.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_event_unfilter.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_initialize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_interrupt_control.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_isr_enter_insert.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_isr_exit_insert.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_object_register.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_object_unregister.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\tx_trace_user_event_insert.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_allocate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_pool_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_block_release.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_allocate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_pool_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_byte_release.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_set.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_event_flags_set_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_mutex_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_flush.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_front_send.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_receive.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_send.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_queue_send_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_ceiling_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_prioritize.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_put.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_semaphore_put_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_entry_exit_notify.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_preemption_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_priority_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_relinquish.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_reset.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_resume.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_suspend.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_terminate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_time_slice_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_thread_wait_abort.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_activate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_change.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_create.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_deactivate.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_delete.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\common\src\txe_timer_info_get.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\tx_initialize_low_level.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,453 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* tx_port.h Win32/Visual */
/* 6.1 */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This file contains data type definitions that make the ThreadX */
/* real-time kernel function identically on a variety of different */
/* processor architectures. For example, the size or number of bits */
/* in an "int" data type vary between microprocessor architectures and */
/* even C compilers for the same microprocessor. ThreadX does not */
/* directly use native C data types. Instead, ThreadX creates its */
/* own special types that can be mapped to actual data types by this */
/* file to guarantee consistency in the interface and functionality. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
#ifndef TX_PORT_H
#define TX_PORT_H
/* Determine if the optional ThreadX user define file should be used. */
#ifdef TX_INCLUDE_USER_DEFINE_FILE
/* Yes, include the user defines in tx_user.h. The defines in this file may
alternately be defined on the command line. */
#include "tx_user.h"
#endif
/* Define compiler library include files. */
#include <stdlib.h>
#include <string.h>
/* Define performance metric symbols. */
#ifndef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
#define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
#define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_MUTEX_ENABLE_PERFORMANCE_INFO
#define TX_MUTEX_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_QUEUE_ENABLE_PERFORMANCE_INFO
#define TX_QUEUE_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
#define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_THREAD_ENABLE_PERFORMANCE_INFO
#define TX_THREAD_ENABLE_PERFORMANCE_INFO
#endif
#ifndef TX_TIMER_ENABLE_PERFORMANCE_INFO
#define TX_TIMER_ENABLE_PERFORMANCE_INFO
#endif
/* Enable trace info. */
#ifndef TX_ENABLE_EVENT_TRACE
#define TX_ENABLE_EVENT_TRACE
#endif
/* Define ThreadX basic types for this port. */
#define VOID void
typedef char CHAR;
typedef unsigned char UCHAR;
typedef int INT;
typedef unsigned int UINT;
typedef long LONG;
typedef unsigned long ULONG;
typedef short SHORT;
typedef unsigned short USHORT;
/* Add Win32 debug insert prototype. */
void _tx_win32_debug_entry_insert(char *action, char *file, unsigned long line);
#ifndef TX_WIN32_DEBUG_ENABLE
/* If Win32 debug is not enabled, turn logging into white-space. */
#define _tx_win32_debug_entry_insert(a, b, c)
#endif
/* Define the TX_MEMSET macro to remove library reference. */
#define TX_MEMSET(a,b,c) { \
UCHAR *ptr; \
UCHAR value; \
UINT i, size; \
ptr = (UCHAR *) ((VOID *) a); \
value = (UCHAR) b; \
size = (UINT) c; \
for (i = 0; i < size; i++) \
{ \
*ptr++ = value; \
} \
}
/* Include windows include file. */
#include <windows.h>
/* Define the priority levels for ThreadX. Legal values range
from 32 to 1024 and MUST be evenly divisible by 32. */
#ifndef TX_MAX_PRIORITIES
#define TX_MAX_PRIORITIES 32
#endif
/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during
thread creation is less than this value, the thread create call will return an error. */
#ifndef TX_MINIMUM_STACK
#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */
#endif
/* Define the system timer thread's default stack size and priority. These are only applicable
if TX_TIMER_PROCESS_IN_ISR is not defined. */
#ifndef TX_TIMER_THREAD_STACK_SIZE
#define TX_TIMER_THREAD_STACK_SIZE 400 /* Default timer thread stack size - Not used in Win32 port! */
#endif
#ifndef TX_TIMER_THREAD_PRIORITY
#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */
#endif
/* Define various constants for the ThreadX port. */
#define TX_INT_DISABLE 1 /* Disable interrupts */
#define TX_INT_ENABLE 0 /* Enable interrupts */
/* Define the clock source for trace event entry time stamp. The following two item are port specific.
For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock
source constants would be:
#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024)
#define TX_TRACE_TIME_MASK 0x0000FFFFUL
*/
#ifndef TX_TRACE_TIME_SOURCE
#define TX_TRACE_TIME_SOURCE ((ULONG) (_tx_win32_time_stamp.LowPart));
#endif
#ifndef TX_TRACE_TIME_MASK
#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL
#endif
/* Define the port-specific trace extension to pickup the Windows timer. */
#define TX_TRACE_PORT_EXTENSION QueryPerformanceCounter((LARGE_INTEGER *)&_tx_win32_time_stamp);
/* Define the port specific options for the _tx_build_options variable. This variable indicates
how the ThreadX library was built. */
#define TX_PORT_SPECIFIC_BUILD_OPTIONS 0
/* Define the in-line initialization constant so that modules with in-line
initialization capabilities can prevent their initialization from being
a function call. */
#define TX_INLINE_INITIALIZATION
/* Define the Win32-specific initialization code that is expanded in the generic source. */
void _tx_initialize_start_interrupts(void);
#define TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION _tx_initialize_start_interrupts();
/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is
disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack
checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING
define is negated, thereby forcing the stack fill which is necessary for the stack checking
logic. */
#ifdef TX_ENABLE_STACK_CHECKING
#undef TX_DISABLE_STACK_FILLING
#endif
/* Define the TX_THREAD control block extensions for this port. The main reason
for the multiple macros is so that backward compatibility can be maintained with
existing ThreadX kernel awareness modules. */
#define TX_THREAD_EXTENSION_0 HANDLE tx_thread_win32_thread_handle; \
DWORD tx_thread_win32_thread_id; \
HANDLE tx_thread_win32_thread_run_semaphore; \
UINT tx_thread_win32_suspension_type; \
UINT tx_thread_win32_int_disabled_flag;
#define TX_THREAD_EXTENSION_1
#define TX_THREAD_EXTENSION_2
#define TX_THREAD_EXTENSION_3
/* Define the port extensions of the remaining ThreadX objects. */
#define TX_BLOCK_POOL_EXTENSION
#define TX_BYTE_POOL_EXTENSION
#define TX_EVENT_FLAGS_GROUP_EXTENSION
#define TX_MUTEX_EXTENSION
#define TX_QUEUE_EXTENSION
#define TX_SEMAPHORE_EXTENSION
#define TX_TIMER_EXTENSION
/* Define the user extension field of the thread control block. Nothing
additional is needed for this port so it is defined as white space. */
#ifndef TX_THREAD_USER_EXTENSION
#define TX_THREAD_USER_EXTENSION
#endif
/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete,
tx_thread_shell_entry, and tx_thread_terminate. */
#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr)
/* Define the ThreadX object creation extensions for the remaining objects. */
#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr)
#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr)
#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr)
#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr)
#define TX_QUEUE_CREATE_EXTENSION(queue_ptr)
#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr)
#define TX_TIMER_CREATE_EXTENSION(timer_ptr)
/* Define the ThreadX object deletion extensions for the remaining objects. */
#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr)
#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr)
#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr)
#define TX_QUEUE_DELETE_EXTENSION(queue_ptr)
#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr)
#define TX_TIMER_DELETE_EXTENSION(timer_ptr)
struct TX_THREAD_STRUCT;
/* Define the Win32 critical section data structure. */
typedef struct TX_WIN32_CRITICAL_SECTION_STRUCT
{
HANDLE tx_win32_critical_section_mutex_handle;
DWORD tx_win32_critical_section_owner;
ULONG tx_win32_critical_section_nested_count;
} TX_WIN32_CRITICAL_SECTION;
/* Define Win32-specific critical section APIs. */
void _tx_win32_critical_section_obtain(TX_WIN32_CRITICAL_SECTION *critical_section);
void _tx_win32_critical_section_release(TX_WIN32_CRITICAL_SECTION *critical_section);
void _tx_win32_critical_section_release_all(TX_WIN32_CRITICAL_SECTION *critical_section);
/* Define post completion processing for tx_thread_delete, so that the Win32 thread resources are properly removed. */
#define TX_THREAD_DELETE_PORT_COMPLETION(thread_ptr) \
{ \
BOOL win32_status; \
DWORD exitcode; \
HANDLE threadrunsemaphore; \
HANDLE threadhandle; \
threadhandle = thread_ptr -> tx_thread_win32_thread_handle; \
threadrunsemaphore = thread_ptr -> tx_thread_win32_thread_run_semaphore; \
_tx_thread_interrupt_restore(tx_saved_posture); \
do \
{ \
win32_status = GetExitCodeThread(threadhandle, &exitcode); \
if ((win32_status) && (exitcode != STILL_ACTIVE)) \
{ \
break; \
} \
ResumeThread(threadhandle); \
ReleaseSemaphore(threadrunsemaphore, 1, NULL); \
Sleep(1); \
} while (1); \
CloseHandle(threadhandle); \
tx_saved_posture = _tx_thread_interrupt_disable(); \
}
/* Define post completion processing for tx_thread_reset, so that the Win32 thread resources are properly removed. */
#define TX_THREAD_RESET_PORT_COMPLETION(thread_ptr) \
{ \
BOOL win32_status; \
DWORD exitcode; \
HANDLE threadrunsemaphore; \
HANDLE threadhandle; \
threadhandle = thread_ptr -> tx_thread_win32_thread_handle; \
threadrunsemaphore = thread_ptr -> tx_thread_win32_thread_run_semaphore; \
_tx_thread_interrupt_restore(tx_saved_posture); \
do \
{ \
win32_status = GetExitCodeThread(threadhandle, &exitcode); \
if ((win32_status) && (exitcode != STILL_ACTIVE)) \
{ \
break; \
} \
ResumeThread(threadhandle); \
ReleaseSemaphore(threadrunsemaphore, 1, NULL); \
Sleep(1); \
} while (1); \
CloseHandle(threadhandle); \
tx_saved_posture = _tx_thread_interrupt_disable(); \
}
/* Define ThreadX interrupt lockout and restore macros for protection on
access of critical kernel information. The restore interrupt macro must
restore the interrupt posture of the running thread prior to the value
present prior to the disable macro. In most cases, the save area macro
is used to define a local function save area for the disable and restore
macros. */
UINT _tx_thread_interrupt_disable(void);
VOID _tx_thread_interrupt_restore(UINT previous_posture);
#define TX_INTERRUPT_SAVE_AREA UINT tx_saved_posture;
#define TX_DISABLE tx_saved_posture = _tx_thread_interrupt_disable();
#define TX_RESTORE _tx_thread_interrupt_restore(tx_saved_posture);
/* Define the interrupt lockout macros for each ThreadX object. */
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
#define TX_BYTE_POOL_DISABLE TX_DISABLE
#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE
#define TX_MUTEX_DISABLE TX_DISABLE
#define TX_QUEUE_DISABLE TX_DISABLE
#define TX_SEMAPHORE_DISABLE TX_DISABLE
/* Define the version ID of ThreadX. This may be utilized by the application. */
#ifdef TX_THREAD_INIT
CHAR _tx_version_id[] =
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Win32/Visual Studio Version 6.1 *";
#else
extern CHAR _tx_version_id[];
#endif
/* Define externals for the Win32 port of ThreadX. */
extern TX_WIN32_CRITICAL_SECTION _tx_win32_critical_section;
extern HANDLE _tx_win32_scheduler_semaphore;
extern DWORD _tx_win32_scheduler_id;
extern ULONG _tx_win32_global_int_disabled_flag;
extern LARGE_INTEGER _tx_win32_time_stamp;
extern ULONG _tx_win32_system_error;
extern HANDLE _tx_win32_timer_handle;
extern DWORD _tx_win32_timer_id;
extern LARGE_INTEGER _tx_win32_time_stamp;
#ifndef TX_WIN32_MEMORY_SIZE
#define TX_WIN32_MEMORY_SIZE 64000
#endif
#ifndef TX_TIMER_PERIODIC
#define TX_TIMER_PERIODIC 18
#endif
#endif

View File

@ -0,0 +1,155 @@
Microsoft's Azure RTOS ThreadX for Win32
Using the Visual Studio Tools
1. Open the ThreadX Project Workspace
In order to build the ThreadX library and the ThreadX demonstration first load
the Azure RTOS Workspace azure_rtos.sln, which is located inside the "example_build"
directory.
2. Building the ThreadX run-time Library
Building the ThreadX library is easy; simply make the "tx" project active and
then select the build button. You should now observe the compilation of the
ThreadX library source. This project build produces the ThreadX library file
tx.lib.
3. Building the Demonstration System
You are now ready to run the ThreadX Win32 demonstration. Simply make the
"sample_thread" project active and then select the build button. When the build
is finished, select the run button from Visual Studio and observe various
demonstration statistics being printed to the console window. You may also set
breakpoints, single step, perform data watches, etc.
4. System Initialization
The system entry point is at main(), which is defined in the application.
Once the application calls tx_kernel_enter, ThreadX starts running and
performs various initialization duties prior to starting the scheduler. The
Win32-specific initialization is done in the function _tx_initialize_low_level,
which is located in the file tx_initialize_low_level.c. This function is
responsible for setting up various system data structures and simulated
interrupts - including the periodic timer interrupt source for ThreadX.
In addition, _tx_initialize_low_level determines the first available
address for use by the application. In Win32, this is basically done
by using malloc to get a big block of memory from Windows.
5. Win32 Implementation
ThreadX for Win32 is implemented using Win32 threads. Each application
thread in ThreadX actually runs as a Win32 thread. The determination of
which application thread to run is made by the ThreadX scheduler, which
itself is a Win32 thread. The ThreadX scheduler is the highest priority
thread in the system.
Interrupts in ThreadX/Win32 are also simulated by threads. A good example
is the ThreadX system timer interrupt, which can be found in
tx_initialize_low_level.c.
5.1 ThreadX Limitations
ThreadX for Win32 behaves in the same manner as ThreadX in an embedded
environment EXCEPT in the case of thread termination. Unfortunately, the
Win32 API does not have a good mechanism to terminate threads and instead
must rely on the thread itself terminating. Hence, threads in the ThreadX
Win32 implementation must have some ThreadX call periodically in their
processing if they can be terminated by another ThreadX thread.
6. Improving Performance
The distribution version of ThreadX is built without any compiler
optimizations. This makes it easy to debug because you can trace or set
breakpoints inside of ThreadX itself. Of course, this costs some
performance. To make it run faster, you can change the tx project file to
enable all compiler optimizations. In addition, you can eliminate the
ThreadX basic API error checking by compiling your application code with the
symbol TX_DISABLE_ERROR_CHECKING defined.
7. Interrupt Handling
ThreadX provides simulated interrupt handling with Win32 threads. Simulated
interrupt threads may be created by the application or may be added to the
simulated timer interrupt defined in tx_initialize_low_level.c. The following
format for creating simulated interrupts should be used:
7.1 Data structures
Here is an example of how to define the Win32 data structures and prototypes
necessary to create a simulated interrupt thread:
HANDLE _sample_win32_interrupt_handle;
DWORD _sample_win32_interrupt_id;
DWORD WINAPI _sample_win32_interrupt(LPVOID);
7.2 Creating a Simulated Interrupt Thread
Here is an example of how to create a simulated interrupt thread in Win32.
This may be done inside of tx_initialize_low_level.c or from your application code
_sample_win32_interrupt_handle =
CreateThread(NULL, 0, _sample_win32_interrupt, (LPVOID) &_sample_win32_interrupt_handle,
CREATE_SUSPENDED, &_sample_win32_interrupt_id);
SetThreadPriority(_sample_win32_interrupt_handle, THREAD_PRIORITY_BELOW_NORMAL);
7.3 Activating the Simulated Interrupt Thread
Simulated interrupt threads should not be activated until initialization is complete, i.e. until
ThreadX is ready to schedule threads. The following activation code may be added to the routine
in tx_initialize_low_level.c called _tx_initialize_start_interrupts or into the application code directly:
ResumeThread(_sample_win32_interrupt_handle);
7.4 Simulated Interrupt Thread Template
The following is a template for the simulated interrupt thread. This interrupt will occur on
a periodic basis.
DWORD WINAPI _sample_win32_interrupt(LPVOID *ptr)
{
while(1)
{
/* Sleep for the desired time. */
Sleep(18);
/* Call ThreadX context save for interrupt preparation. */
_tx_thread_context_save();
/* Call application ISR here! */
/* Call ThreadX context restore for interrupt completion. */
_tx_thread_context_restore();
}
}
8. Revision History
For generic code revision information, please refer to the readme_threadx_generic.txt
file, which is included in your distribution. The following details the revision
information associated with this specific port of ThreadX:
09-30-2020 Initial ThreadX version for Win32 using Microsoft Visual C/C++.
Copyright(c) 1996-2020 Microsoft Corporation
https://azure.com/rtos

View File

@ -0,0 +1,307 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Initialize */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
/* Define various Win32 objects used by the ThreadX port. */
TX_WIN32_CRITICAL_SECTION _tx_win32_critical_section;
HANDLE _tx_win32_scheduler_semaphore;
DWORD _tx_win32_scheduler_id;
ULONG _tx_win32_global_int_disabled_flag;
LARGE_INTEGER _tx_win32_time_stamp;
ULONG _tx_win32_system_error;
extern TX_THREAD *_tx_thread_current_ptr;
/* Define simulated timer interrupt. This is done inside a thread, which is
how other interrupts may be defined as well. See code below for an
example. */
HANDLE _tx_win32_timer_handle;
DWORD _tx_win32_timer_id;
DWORD WINAPI _tx_win32_timer_interrupt(LPVOID p);
#ifdef TX_WIN32_DEBUG_ENABLE
extern ULONG _tx_thread_system_state;
extern UINT _tx_thread_preempt_disable;
extern TX_THREAD *_tx_thread_current_ptr;
extern TX_THREAD *_tx_thread_execute_ptr;
/* Define the maximum size of the Win32 debug array. */
#ifndef TX_WIN32_DEBUG_EVENT_SIZE
#define TX_WIN32_DEBUG_EVENT_SIZE 400
#endif
/* Define debug log in order to debug Win32 issues with this port. */
typedef struct TX_WIN32_DEBUG_ENTRY_STRUCT
{
char *tx_win32_debug_entry_action;
LARGE_INTEGER tx_win32_debug_entry_timestamp;
char *tx_win32_debug_entry_file;
unsigned long tx_win32_debug_entry_line;
TX_WIN32_CRITICAL_SECTION tx_win32_debug_entry_critical_section;
unsigned long tx_win32_debug_entry_int_disabled_flag;
ULONG tx_win32_debug_entry_system_state;
UINT tx_win32_debug_entry_preempt_disable;
TX_THREAD *tx_win32_debug_entry_current_thread;
DWORD tx_win32_debug_entry_current_thread_id;
TX_THREAD *tx_win32_debug_entry_execute_thread;
DWORD tx_win32_debug_entry_execute_thread_id;
DWORD tx_win32_debug_entry_running_id;
} TX_WIN32_DEBUG_ENTRY;
/* Define the circular array of Win32 debug entries. */
TX_WIN32_DEBUG_ENTRY _tx_win32_debug_entry_array[TX_WIN32_DEBUG_EVENT_SIZE];
/* Define the Win32 debug index. */
unsigned long _tx_win32_debug_entry_index = 0;
/* Now define the debug entry function. */
void _tx_win32_debug_entry_insert(char *action, char *file, unsigned long line)
{
/* Get the time stamp. */
QueryPerformanceCounter((LARGE_INTEGER *)&_tx_win32_time_stamp);
/* Setup the debug entry. */
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_action = action;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_timestamp = _tx_win32_time_stamp;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_file = file;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_line = line;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_critical_section = _tx_win32_critical_section;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_int_disabled_flag = _tx_win32_global_int_disabled_flag;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_system_state = _tx_thread_system_state;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_preempt_disable = _tx_thread_preempt_disable;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_current_thread = _tx_thread_current_ptr;
if (_tx_thread_current_ptr)
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_current_thread_id = _tx_thread_current_ptr -> tx_thread_win32_thread_id;
else
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_current_thread_id = 0;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_execute_thread = _tx_thread_execute_ptr;
if (_tx_thread_execute_ptr)
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_execute_thread_id = _tx_thread_execute_ptr -> tx_thread_win32_thread_id;
else
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_execute_thread_id = 0;
_tx_win32_debug_entry_array[_tx_win32_debug_entry_index].tx_win32_debug_entry_running_id = GetCurrentThreadId();
/* Now move to the next entry. */
_tx_win32_debug_entry_index++;
/* Determine if we need to wrap the list. */
if (_tx_win32_debug_entry_index >= TX_WIN32_DEBUG_EVENT_SIZE)
{
/* Yes, wrap the list! */
_tx_win32_debug_entry_index = 0;
}
}
#endif
/* Define the ThreadX timer interrupt handler. */
void _tx_timer_interrupt(void);
/* Define other external function references. */
VOID _tx_initialize_low_level(VOID);
VOID _tx_thread_context_save(VOID);
VOID _tx_thread_context_restore(VOID);
/* Define other external variable references. */
extern VOID *_tx_initialize_unused_memory;
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_initialize_low_level Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for any low-level processor */
/* initialization, including setting up interrupt vectors, setting */
/* up a periodic timer interrupt source, saving the system stack */
/* pointer for use in ISR processing later, and finding the first */
/* available RAM memory address for tx_application_define. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* CreateMutex Win32 create mutex */
/* CreateThread Win32 create thread */
/* CreateSemaphore Win32 create semaphore */
/* GetCurrentThreadId Win32 get current thread ID */
/* SetProcessAffinityMask Win32 process affinity set */
/* SetThreadPriority Win32 set thread priority */
/* */
/* CALLED BY */
/* */
/* _tx_initialize_kernel_enter ThreadX entry function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_initialize_low_level(VOID)
{
/* Deprecate TX_WIN32_MULTI_CORE build option and default to restricting
execution to one core. */
#ifndef TX_WIN32_BYPASS_AFFINITY_SETUP
/* Limit this ThreadX simulation on Win32 to a single core. */
if (SetProcessAffinityMask( GetCurrentProcess(), 1 ) == 0)
{
/* Error restricting the process to one core. */
printf("ThreadX Win32 error restricting the process to one core!\n");
while(1)
{
}
}
#endif
/* Pickup the first available memory address. */
/* Save the first available memory address. */
_tx_initialize_unused_memory = malloc(TX_WIN32_MEMORY_SIZE);
/* Pickup the unique Id of the current thread, which will also be the Id of the scheduler. */
_tx_win32_scheduler_id = GetCurrentThreadId();
/* Create the system critical section mutex. This is used by the system to block all other access,
analogous to an interrupt lockout on an embedded target. */
_tx_win32_critical_section.tx_win32_critical_section_mutex_handle = CreateMutex(NULL, FALSE, NULL);
_tx_win32_critical_section.tx_win32_critical_section_nested_count = 0;
_tx_win32_critical_section.tx_win32_critical_section_owner = 0;
/* Create the semaphore that regulates when the scheduler executes. */
_tx_win32_scheduler_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
/* Initialize the global interrupt disabled flag. */
_tx_win32_global_int_disabled_flag = TX_FALSE;
/* Setup periodic timer interrupt. */
_tx_win32_timer_handle =
CreateThread(NULL, 0, _tx_win32_timer_interrupt, (LPVOID) &_tx_win32_timer_handle,CREATE_SUSPENDED, &_tx_win32_timer_id);
/* Check for a good thread create. */
if (!_tx_win32_timer_handle)
{
/* Error creating the timer interrupt. */
printf("ThreadX Win32 error creating timer interrupt thread!\n");
while(1)
{
}
}
/* Otherwise, we have a good thread create. Now set the priority to
a level lower than the system thread but higher than the application
threads. */
SetThreadPriority(_tx_win32_timer_handle, THREAD_PRIORITY_BELOW_NORMAL);
/* Done, return to caller. */
}
/* This routine is called after initialization is complete in order to start
all interrupt threads. Interrupt threads in addition to the timer may
be added to this routine as well. */
void _tx_initialize_start_interrupts(void)
{
/* Kick the timer thread off to generate the ThreadX periodic interrupt
source. */
ResumeThread(_tx_win32_timer_handle);
}
/* Define the ThreadX system timer interrupt. Other interrupts may be simulated
in a similar way. */
DWORD WINAPI _tx_win32_timer_interrupt(LPVOID p)
{
while(1)
{
/* Sleep for the desired time. */
Sleep(TX_TIMER_PERIODIC);
/* Call ThreadX context save for interrupt preparation. */
_tx_thread_context_save();
/* Call the ThreadX system timer interrupt processing. */
_tx_timer_interrupt();
/* Call ThreadX context restore for interrupt completion. */
_tx_thread_context_restore();
}
}

View File

@ -0,0 +1,132 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_context_restore Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function restores the interrupt context if it is processing a */
/* nested interrupt. If not, it returns to the interrupt thread if no */
/* preemption is necessary. Otherwise, if preemption is necessary or */
/* if no thread was running, the function returns to the scheduler. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* ReleaseSemaphore Win32 release semaphore */
/* ResumeThread Win32 resume thread */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* */
/* CALLED BY */
/* */
/* ISRs Interrupt Service Routines */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_context_restore(VOID)
{
/* Enter critical section to ensure other threads are not playing with
the core ThreadX data structures. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Debug entry. */
_tx_win32_debug_entry_insert("CONTEXT_RESTORE", __FILE__, __LINE__);
/* Decrement the nested interrupt count. */
_tx_thread_system_state--;
/* Determine if this is the first nested interrupt and if a ThreadX
application thread was running at the time. */
if ((!_tx_thread_system_state) && (_tx_thread_current_ptr))
{
/* Yes, this is the first and last interrupt processed. */
/* Check to see if preemption is required. */
if ((_tx_thread_preempt_disable == 0) && (_tx_thread_current_ptr != _tx_thread_execute_ptr))
{
/* Preempt the running application thread. We don't need to suspend the
application thread since that is done in the context save processing. */
/* Indicate that this thread was suspended asynchronously. */
_tx_thread_current_ptr -> tx_thread_win32_suspension_type = 1;
/* Save the remaining time-slice and disable it. */
if (_tx_timer_time_slice)
{
_tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
_tx_timer_time_slice = 0;
}
/* Clear the current thread pointer. */
_tx_thread_current_ptr = TX_NULL;
/* Wakeup the system thread by setting the system semaphore. */
ReleaseSemaphore(_tx_win32_scheduler_semaphore, 1, NULL);
}
else
{
/* Since preemption is not required, resume the interrupted thread. */
ResumeThread(_tx_thread_current_ptr -> tx_thread_win32_thread_handle);
}
}
/* Leave Win32 critical section. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
}

View File

@ -0,0 +1,113 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_context_save Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function saves the context of an executing thread in the */
/* beginning of interrupt processing. The function also ensures that */
/* the system stack is used upon return to the calling ISR. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* SuspendThread Win32 thread suspend */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* */
/* CALLED BY */
/* */
/* ISRs */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_context_save(VOID)
{
TX_THREAD *thread_ptr;
/* Enter critical section to ensure other threads are not playing with
the core ThreadX data structures. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Debug entry. */
_tx_win32_debug_entry_insert("CONTEXT_SAVE", __FILE__, __LINE__);
/* Pickup the current thread pointer. */
thread_ptr = _tx_thread_current_ptr;
/* If an application thread is running, suspend it to simulate preemption. */
if ((thread_ptr) && (_tx_thread_system_state == 0))
{
/* Yes, this is the first interrupt and an application thread is running...
suspend it! */
/* Suspend the thread to simulate preemption. Note that the thread is suspended BEFORE the protection get
flag is checked to ensure there is not a race condition between this thread and the update of that flag. */
SuspendThread(thread_ptr -> tx_thread_win32_thread_handle);
/* Debug entry. */
_tx_win32_debug_entry_insert("CONTEXT_SAVE-suspend_thread", __FILE__, __LINE__);
}
/* Increment the nested interrupt condition. */
_tx_thread_system_state++;
/* Exit Win32 critical section. */
_tx_win32_critical_section_release(&_tx_win32_critical_section);
}

View File

@ -0,0 +1,213 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include <winbase.h>
/* Define small routines used for the TX_DISABLE/TX_RESTORE macros. */
UINT _tx_thread_interrupt_disable(void)
{
UINT previous_value;
previous_value = _tx_thread_interrupt_control(TX_INT_DISABLE);
return(previous_value);
}
VOID _tx_thread_interrupt_restore(UINT previous_posture)
{
previous_posture = _tx_thread_interrupt_control(previous_posture);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_interrupt_control Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is responsible for changing the interrupt lockout */
/* posture of the system. */
/* */
/* INPUT */
/* */
/* new_posture New interrupt lockout posture */
/* */
/* OUTPUT */
/* */
/* old_posture Old interrupt lockout posture */
/* */
/* CALLS */
/* */
/* ExitThread Win32 thread exit */
/* GetCurrentThread Win32 get current thread */
/* GetCurrentThreadId Win32 get current thread ID */
/* GetThreadPriority Win32 get thread priority */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* _tx_win32_critical_section_release_all */
/* Release critical section */
/* */
/* CALLED BY */
/* */
/* Application Code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _tx_thread_interrupt_control(UINT new_posture)
{
UINT old_posture;
HANDLE threadhandle;
int threadpriority;
DWORD threadid;
TX_THREAD *thread_ptr;
/* Enter Win32 critical section. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
#ifdef TX_WIN32_DEBUG_ENABLE
/* Determine if this is a disable or enable request. */
if (new_posture == TX_INT_ENABLE)
{
/* Enable. */
_tx_win32_debug_entry_insert("RESTORE", __FILE__, __LINE__);
}
else
{
/* Disable. */
_tx_win32_debug_entry_insert("DISABLE", __FILE__, __LINE__);
}
#endif
/* Determine if the thread was terminated. */
/* Pickup the handle of the current thread. */
threadhandle = GetCurrentThread();
/* Pickup the current thread pointer. */
thread_ptr = _tx_thread_current_ptr;
/* Pickup the priority of the current thread. */
threadpriority = GetThreadPriority(threadhandle);
/* Pickup the ID of the current thread. */
threadid = GetCurrentThreadId();
/* Determine if this is a thread (THREAD_PRIORITY_LOWEST) and it does not
match the current thread pointer. */
if ((threadpriority == THREAD_PRIORITY_LOWEST) &&
((!thread_ptr) || (thread_ptr -> tx_thread_win32_thread_id != threadid)))
{
/* This indicates the Win32 thread was actually terminated by ThreadX is only
being allowed to run in order to cleanup its resources. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
/* Exit this thread. */
ExitThread(0);
}
/* Determine the current interrupt lockout condition. */
if (_tx_win32_critical_section.tx_win32_critical_section_nested_count == 1)
{
/* First pass through, interrupts are enabled. */
old_posture = TX_INT_ENABLE;
}
else
{
/* Interrupts are disabled. */
old_posture = TX_INT_DISABLE;
}
/* First, determine if this call is from a non-thread. */
if (_tx_thread_system_state)
{
/* Determine how to apply the new posture. */
if (new_posture == TX_INT_ENABLE)
{
/* Clear the disabled flag. */
_tx_win32_global_int_disabled_flag = TX_FALSE;
/* Determine if the critical section is locked. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
}
else if (new_posture == TX_INT_DISABLE)
{
/* Set the disabled flag. */
_tx_win32_global_int_disabled_flag = TX_TRUE;
}
}
else if (thread_ptr)
{
/* Determine how to apply the new posture. */
if (new_posture == TX_INT_ENABLE)
{
/* Clear the disabled flag. */
_tx_thread_current_ptr -> tx_thread_win32_int_disabled_flag = TX_FALSE;
/* Determine if the critical section is locked. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
}
else if (new_posture == TX_INT_DISABLE)
{
/* Set the disabled flag. */
_tx_thread_current_ptr -> tx_thread_win32_int_disabled_flag = TX_TRUE;
}
}
/* Return the previous interrupt disable posture. */
return(old_posture);
}

View File

@ -0,0 +1,291 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_schedule Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function waits for a thread control block pointer to appear in */
/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
/* in the variable, the corresponding thread is resumed. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* ReleaseSemaphore Win32 release semaphore */
/* ResumeThread Win32 resume thread */
/* Sleep Win32 thread sleep */
/* WaitForSingleObject Win32 wait on a semaphore */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* */
/* CALLED BY */
/* */
/* _tx_initialize_kernel_enter ThreadX entry function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_schedule(VOID)
{
/* Loop forever. */
while(1)
{
/* Wait for a thread to execute and all ISRs to complete. */
while(1)
{
/* Enter Win32 critical section. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Debug entry. */
_tx_win32_debug_entry_insert("SCHEDULE-wake_up", __FILE__, __LINE__);
/* Determine if there is a thread ready to execute AND all ISRs
are complete. */
if ((_tx_thread_execute_ptr != TX_NULL) && (_tx_thread_system_state == 0))
{
/* Get out of this loop and schedule the thread! */
break;
}
else
{
/* Leave the critical section. */
_tx_win32_critical_section_release(&_tx_win32_critical_section);
/* Now sleep so we don't block forever. */
Sleep(2);
}
}
/* Yes! We have a thread to execute. Note that the critical section is already
active from the scheduling loop above. */
/* Setup the current thread pointer. */
_tx_thread_current_ptr = _tx_thread_execute_ptr;
/* Increment the run count for this thread. */
_tx_thread_current_ptr -> tx_thread_run_count++;
/* Setup time-slice, if present. */
_tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice;
/* Determine how the thread was suspended. */
if (_tx_thread_current_ptr -> tx_thread_win32_suspension_type)
{
/* Debug entry. */
_tx_win32_debug_entry_insert("SCHEDULE-resume_thread", __FILE__, __LINE__);
/* Pseudo interrupt suspension. The thread is not waiting on
its run semaphore. */
ResumeThread(_tx_thread_current_ptr -> tx_thread_win32_thread_handle);
}
else
{
/* Debug entry. */
_tx_win32_debug_entry_insert("SCHEDULE-release_sem", __FILE__, __LINE__);
/* Let the thread run again by releasing its run semaphore. */
ReleaseSemaphore(_tx_thread_current_ptr -> tx_thread_win32_thread_run_semaphore, 1, NULL);
}
/* Debug entry. */
_tx_win32_debug_entry_insert("SCHEDULE-self_suspend_sem", __FILE__, __LINE__);
/* Exit Win32 critical section. */
_tx_win32_critical_section_release(&_tx_win32_critical_section);
/* Now suspend the main thread so the application thread can run. */
WaitForSingleObject(_tx_win32_scheduler_semaphore, INFINITE);
}
}
/* Define the ThreadX Win32 critical section get, release, and release all functions. */
void _tx_win32_critical_section_obtain(TX_WIN32_CRITICAL_SECTION *critical_section)
{
TX_THREAD *thread_ptr;
/* Is the protection owned? */
if (critical_section -> tx_win32_critical_section_owner == GetCurrentThreadId())
{
/* Simply increment the nested counter. */
critical_section -> tx_win32_critical_section_nested_count++;
}
else
{
/* Pickup the current thread pointer. */
thread_ptr = _tx_thread_current_ptr;
/* Get the Win32 critical section. */
while (WaitForSingleObject(critical_section -> tx_win32_critical_section_mutex_handle, 3) != WAIT_OBJECT_0)
{
}
/* At this point we have the mutex. */
/* Increment the nesting counter. */
critical_section -> tx_win32_critical_section_nested_count = 1;
/* Remember the owner. */
critical_section -> tx_win32_critical_section_owner = GetCurrentThreadId();
}
}
void _tx_win32_critical_section_release(TX_WIN32_CRITICAL_SECTION *critical_section)
{
/* Ensure the caller is the mutex owner. */
if (critical_section -> tx_win32_critical_section_owner == GetCurrentThreadId())
{
/* Determine if there is protection. */
if (critical_section -> tx_win32_critical_section_nested_count)
{
/* Decrement the nesting counter. */
critical_section -> tx_win32_critical_section_nested_count--;
/* Determine if the critical section is now being released. */
if (critical_section -> tx_win32_critical_section_nested_count == 0)
{
/* Yes, it is being released clear the owner. */
critical_section -> tx_win32_critical_section_owner = 0;
/* Finally, release the mutex. */
if (ReleaseMutex(critical_section -> tx_win32_critical_section_mutex_handle) != TX_TRUE)
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
/* Just in case, make sure there the mutex is not owned. */
while (ReleaseMutex(critical_section -> tx_win32_critical_section_mutex_handle) == TX_TRUE)
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
/* Sleep for 0, just to relinquish to other ready threads. */
Sleep(0);
}
}
}
else
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
}
void _tx_win32_critical_section_release_all(TX_WIN32_CRITICAL_SECTION *critical_section)
{
/* Ensure the caller is the mutex owner. */
if (critical_section -> tx_win32_critical_section_owner == GetCurrentThreadId())
{
/* Determine if there is protection. */
if (critical_section -> tx_win32_critical_section_nested_count)
{
/* Clear the nesting counter. */
critical_section -> tx_win32_critical_section_nested_count = 0;
/* Yes, it is being release clear the owner. */
critical_section -> tx_win32_critical_section_owner = 0;
/* Finally, release the mutex. */
if (ReleaseMutex(critical_section -> tx_win32_critical_section_mutex_handle) != TX_TRUE)
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
/* Just in case, make sure there the mutex is not owned. */
while (ReleaseMutex(critical_section -> tx_win32_critical_section_mutex_handle) == TX_TRUE)
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
}
}
else
{
/* Increment the system error counter. */
_tx_win32_system_error++;
}
}

View File

@ -0,0 +1,157 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include <stdio.h>
/* Prototype for new thread entry function. */
DWORD WINAPI _tx_win32_thread_entry(LPVOID p);
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_stack_build Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function builds a stack frame on the supplied thread's stack. */
/* The stack frame results in a fake interrupt return to the supplied */
/* function pointer. */
/* */
/* INPUT */
/* */
/* thread_ptr Pointer to thread control blk */
/* function_ptr Pointer to return function */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* CreateThread Win32 create thread */
/* ResumeThread Win32 resume thread */
/* SetThreadPriority Win32 set thread priority */
/* */
/* CALLED BY */
/* */
/* _tx_thread_create Create thread service */
/* _tx_thread_reset Reset thread service */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
{
/* Create a Win32 thread for the application thread. */
thread_ptr -> tx_thread_win32_thread_handle =
CreateThread(NULL, 0, _tx_win32_thread_entry, (LPVOID) thread_ptr, CREATE_SUSPENDED,
&(thread_ptr -> tx_thread_win32_thread_id));
/* Check for a good thread create. */
if (!thread_ptr -> tx_thread_win32_thread_handle)
{
/* Display an error message. */
printf("ThreadX Win32 error creating thread!\n");
while(1)
{
}
}
/* Otherwise, we have a good thread create. Now set the priority to
a lower level. */
SetThreadPriority(thread_ptr -> tx_thread_win32_thread_handle, THREAD_PRIORITY_LOWEST);
/* Create the run semaphore for the thread. This will allow the scheduler
control over when the thread actually runs. */
thread_ptr -> tx_thread_win32_thread_run_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
/* Determine if the run semaphore was created successfully. */
if (!thread_ptr -> tx_thread_win32_thread_run_semaphore)
{
/* Display an error message. */
printf("ThreadX Win32 error creating thread running semaphore!\n");
while(1)
{
}
}
/* Setup the thread suspension type to solicited thread suspension.
Pseudo interrupt handlers will suspend with this field set to 1. */
thread_ptr -> tx_thread_win32_suspension_type = 0;
/* Clear the disabled count that will keep track of the
tx_interrupt_control nesting. */
thread_ptr -> tx_thread_win32_int_disabled_flag = 0;
/* Setup a fake thread stack pointer. */
thread_ptr -> tx_thread_stack_ptr = (VOID *) (((CHAR *) thread_ptr -> tx_thread_stack_end) - 8);
/* Clear the first word of the stack. */
*(((ULONG *) thread_ptr -> tx_thread_stack_ptr) - 1) = 0;
/* Make the thread initially ready so it will run to the initial wait on
its run semaphore. */
ResumeThread(thread_ptr -> tx_thread_win32_thread_handle);
}
DWORD WINAPI _tx_win32_thread_entry(LPVOID ptr)
{
TX_THREAD *thread_ptr;
/* Pickup the current thread pointer. */
thread_ptr = (TX_THREAD *) ptr;
/* Now suspend the thread initially. If the thread has already
been scheduled, this will return immediately. */
WaitForSingleObject(thread_ptr -> tx_thread_win32_thread_run_semaphore, INFINITE);
/* Call ThreadX thread entry point. */
_tx_thread_shell_entry();
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,212 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Thread */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_timer.h"
#include <stdio.h>
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_thread_system_return Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function is target processor specific. It is used to transfer */
/* control from a thread back to the system. Only a minimal context */
/* is saved since the compiler assumes temp registers are going to get */
/* slicked by a function call anyway. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* _tx_win32_critical_section_release_all */
/* Release critical section */
/* ExitThread Win32 thread exit */
/* GetCurrentThread Win32 get current thread */
/* GetCurrentThreadId Win32 get current thread ID */
/* GetThreadPriority Win32 get thread priority */
/* ReleaseSemaphore Win32 release semaphore */
/* WaitForSingleObject Win32 wait on semaphore */
/* */
/* CALLED BY */
/* */
/* ThreadX components */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_thread_system_return(VOID)
{
TX_THREAD *temp_thread_ptr;
HANDLE temp_run_semaphore;
UINT temp_thread_state;
HANDLE threadhandle;
int threadpriority;
DWORD threadid;
/* Enter Win32 critical section. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Pickup the handle of the current thread. */
threadhandle = GetCurrentThread();
/* Debug entry. */
_tx_win32_debug_entry_insert("SYSTEM_RETURN", __FILE__, __LINE__);
/* First, determine if the thread was terminated. */
/* Pickup the priority of the current thread. */
threadpriority = GetThreadPriority(threadhandle);
/* Pickup the ID of the current thread. */
threadid = GetCurrentThreadId();
/* Pickup the current thread pointer. */
temp_thread_ptr = _tx_thread_current_ptr;
/* Determine if this is a thread (THREAD_PRIORITY_LOWEST) and it does not
match the current thread pointer. */
if ((threadpriority == THREAD_PRIORITY_LOWEST) &&
((!temp_thread_ptr) || (temp_thread_ptr -> tx_thread_win32_thread_id != threadid)))
{
/* This indicates the Win32 thread was actually terminated by ThreadX and is only
being allowed to run in order to cleanup its resources. */
/* Release critical section. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
/* Exit thread. */
ExitThread(0);
}
/* Determine if the time-slice is active. */
if (_tx_timer_time_slice)
{
/* Preserve current remaining time-slice for the thread and clear the current time-slice. */
temp_thread_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
_tx_timer_time_slice = 0;
}
/* Save the run semaphore into a temporary variable as well. */
temp_run_semaphore = temp_thread_ptr -> tx_thread_win32_thread_run_semaphore;
/* Pickup the current thread state. */
temp_thread_state = temp_thread_ptr -> tx_thread_state;
/* Setup the suspension type for this thread. */
temp_thread_ptr -> tx_thread_win32_suspension_type = 0;
/* Set the current thread pointer to NULL. */
_tx_thread_current_ptr = TX_NULL;
/* Debug entry. */
_tx_win32_debug_entry_insert("SYSTEM_RETURN-release_sem", __FILE__, __LINE__);
/* Release the semaphore that the main scheduling thread is waiting
on. Note that the main scheduling algorithm will take care of
setting the current thread pointer to NULL. */
ReleaseSemaphore(_tx_win32_scheduler_semaphore, 1, NULL);
/* Leave Win32 critical section. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
/* Determine if the thread was self-terminating. */
if (temp_thread_state == TX_TERMINATED)
{
/* Exit the thread instead of waiting on the semaphore! */
ExitThread(0);
}
/* Wait on the run semaphore for this thread. This won't get set again
until the thread is scheduled. */
WaitForSingleObject(temp_run_semaphore, INFINITE);
/* Enter Win32 critical section. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Debug entry. */
_tx_win32_debug_entry_insert("SYSTEM_RETURN-wake_up", __FILE__, __LINE__);
/* Determine if the thread was terminated. */
/* Pickup the current thread pointer. */
temp_thread_ptr = _tx_thread_current_ptr;
/* Determine if this is a thread (THREAD_PRIORITY_LOWEST) and it does not
match the current thread pointer. */
if ((threadpriority == THREAD_PRIORITY_LOWEST) &&
((!temp_thread_ptr) || (temp_thread_ptr -> tx_thread_win32_thread_id != threadid)))
{
/* Leave Win32 critical section. */
_tx_win32_critical_section_release_all(&_tx_win32_critical_section);
/* This indicates the Win32 thread was actually terminated by ThreadX and is only
being allowed to run in order to cleanup its resources. */
ExitThread(0);
}
/* Now determine if the application thread last had interrupts disabled. */
/* Debug entry. */
_tx_win32_debug_entry_insert("SYSTEM_RETURN-finish", __FILE__, __LINE__);
/* Determine if this thread had interrupts disabled. */
if (!_tx_thread_current_ptr -> tx_thread_win32_int_disabled_flag)
{
/* Leave Win32 critical section. */
_tx_win32_critical_section_release(&_tx_win32_critical_section);
}
}

View File

@ -0,0 +1,153 @@
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Timer */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
/* Include necessary system files. */
#include "tx_api.h"
#include "tx_timer.h"
#include "tx_thread.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _tx_timer_interrupt Win32/Visual */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the hardware timer interrupt. This */
/* processing includes incrementing the system clock and checking for */
/* time slice and/or timer expiration. If either is found, the */
/* interrupt context save/restore functions are called along with the */
/* expiration functions. */
/* */
/* INPUT */
/* */
/* None */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _tx_thread_time_slice Time slice interrupted thread */
/* _tx_timer_expiration_process Timer expiration processing */
/* _tx_win32_critical_section_obtain Obtain critical section */
/* _tx_win32_critical_section_release Release critical section */
/* */
/* CALLED BY */
/* */
/* interrupt vector */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _tx_timer_interrupt(VOID)
{
/* Enter critical section to ensure other threads are not playing with
the core ThreadX data structures. */
_tx_win32_critical_section_obtain(&_tx_win32_critical_section);
/* Debug entry. */
_tx_win32_debug_entry_insert("TIMER INTERRUPT", __FILE__, __LINE__);
/* Increment the system clock. */
_tx_timer_system_clock++;
/* Test for time-slice expiration. */
if (_tx_timer_time_slice)
{
/* Decrement the time_slice. */
_tx_timer_time_slice--;
/* Check for expiration. */
if (_tx_timer_time_slice == 0)
{
/* Set the time-slice expired flag. */
_tx_timer_expired_time_slice = TX_TRUE;
}
}
/* Test for timer expiration. */
if (*_tx_timer_current_ptr)
{
/* Set expiration flag. */
_tx_timer_expired = TX_TRUE;
}
else
{
/* No timer expired, increment the timer pointer. */
_tx_timer_current_ptr++;
/* Check for wrap-around. */
if (_tx_timer_current_ptr == _tx_timer_list_end)
{
/* Wrap to beginning of list. */
_tx_timer_current_ptr = _tx_timer_list_start;
}
}
/* See if anything has expired. */
if ((_tx_timer_expired_time_slice) || (_tx_timer_expired))
{
/* Did a timer expire? */
if (_tx_timer_expired)
{
/* Process timer expiration. */
_tx_timer_expiration_process();
}
/* Did time slice expire? */
if (_tx_timer_expired_time_slice)
{
/* Time slice interrupted thread. */
_tx_thread_time_slice();
}
}
/* Exit Win32 critical section. */
_tx_win32_critical_section_release(&_tx_win32_critical_section);
}

View File

@ -1,5 +1,7 @@
# Doxyfile 1.9.2
@INCLUDE = ../../ql-doxygen/Doxyfile-QL
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
@ -39,16 +41,6 @@ PYTHON_DOCSTRING = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES = "next{1}=<hr><b>Next:</b> @ref \1</p>" \
"description=@par Description" \
"amplification=@par Amplification" \
"rationale=@par Rationale" \
"caption{1}=<div class=\"caption\" align=\"center\">\1</div>" \
"hint=@par Hint" \
"usage=@par Usage" \
"termref{2}=<a class=\"extern\" target=\"_blank\" href=\"https://www.state-machine.com/\1\">\2</a>" \
"reqdef{1}=@anchor \1 @xrefitem reqdef \"Requirement\" \"Requirement Index\" @ref \1" \
"reqref{1}=@ref \1 \"\1\""
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
@ -130,29 +122,32 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
INPUT = main.dox \
gs.dox \
../../qp-doxygen/srs.dox \
struct.dox \
api.dox \
exa.dox \
exa_apps.dox \
exa_native.dox \
../../ql-doxygen/exa_low-power.dox \
../../qp-doxygen/exa_low-power.dox \
exa_rtos.dox \
exa_os.dox \
exa_qutest.dox \
exa_mware.dox \
ports.dox \
ports_native.dox \
../../ql-doxygen/ports_arm-cm.dox \
../../qp-doxygen/ports_arm-cm.dox \
ports_rtos.dox \
ports_os.dox \
history.dox \
macros.h \
../../qp-doxygen/tr.dox \
metrics.dox \
history.dox \
../../ql-doxygen/help.dox \
modules.dox \
macros.h \
../include \
../src \
../ports/lint-plus \
../../ql-doxygen/help.dox
../ports/lint-plus
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.dox \
*.h \
@ -174,7 +169,8 @@ EXAMPLE_PATH = snippets \
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = images \
../../ql-doxygen/images
../../ql-doxygen/images \
../../qp-doxygen/images
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
@ -212,7 +208,8 @@ HTML_FOOTER = ../../ql-doxygen/footer-awesome.html
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/doxygen-awesome.css \
../../ql-doxygen/ql-awesome.css
HTML_EXTRA_FILES = ../../ql-doxygen/doxygen-awesome-darkmode-toggle.js
HTML_EXTRA_FILES = ../../ql-doxygen/doxygen-awesome-darkmode-toggle.js \
../../ql-doxygen/preview.js
HTML_COLORSTYLE_HUE = 209
HTML_COLORSTYLE_SAT = 255
HTML_COLORSTYLE_GAMMA = 113
@ -263,71 +260,9 @@ SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTERNAL_SEARCH_ID = QPC
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
LATEX_MAKEINDEX_CMD = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
@ -353,51 +288,3 @@ PREDEFINED = Q_SPY \
QS_TIME_SIZE
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = YES
UML_LIMIT_NUM_FIELDS = 10
DOT_UML_DETAILS = NO
DOT_WRAP_THRESHOLD = 17
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH = C:/tools/graphviz/bin
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@ -1,4 +1,4 @@
# Doxyfile 1.9.0
# Doxyfile 1.9.2
@INCLUDE = Doxyfile
@ -8,6 +8,7 @@
HTML_OUTPUT = tmp
HTML_HEADER = ../../ql-doxygen/header.html
HTML_FOOTER = ../../ql-doxygen/footer.html
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/ql.css
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/ql.css \
../../ql-doxygen/preview.js
HTML_EXTRA_FILES =
GENERATE_HTMLHELP = YES

View File

@ -1,10 +0,0 @@
# Doxyfile 1.9.0
@INCLUDE = Doxyfile
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = main.dox \
srs.dox \
modules.dox

23
doxygen/Doxyfile-TST Normal file
View File

@ -0,0 +1,23 @@
# Doxyfile 1.9.2
@INCLUDE = Doxyfile
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# minim#al build of documentation only (delete eventually...)
INPUT = main.dox \
gs.dox \
../../qp-doxygen/srs.dox \
../../qp-doxygen/sas.dox \
../../qp-doxygen/sds.dox \
../../ql-doxygen/tr.dox \
../../ql-doxygen/help.dox \
macros.h \
../include/qep.h
EXAMPLE_PATH =
HAVE_DOT = NO

View File

@ -238,3 +238,6 @@ QXK is a small, preemptive, priority-based, dual-mode **blocking** kernel that e
- QXK_TLS()
*/
/*##########################################################################*/
/*! @page deprecated Deprecated APIs
*/

View File

@ -1,9 +1,5 @@
/*! @page exa Examples
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@tableofcontents
@section exa_gen General Comments
@ -314,14 +310,9 @@ To work with QP/C effectively, you need to learn a bit more about active objects
/*##########################################################################*/
/*! @page exa_ref Cross-Reference
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@tableofcontents
@section exa_ref_kernel Native Examples (by Built-in Kernel)
- @ref exa_qv
- @ref exa_qk

View File

@ -21,10 +21,6 @@ Click on the following links to see examples for the specified CPU architectures
/*##########################################################################*/
/*! @page exa_qv QV Kernel (Non-Preemptive, Priority-Based, Non-Blocking)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -49,10 +45,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_qk QK Kernel (Preemptive, Run-To-Completion/Non-Blocking)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -78,10 +70,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_qxk QXK Kernel (Preemptive, Run-To-Completion/Blocking)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -96,10 +84,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_arm-cm ARM Cortex-M (Cortex-M0/M0+/M3/M4/M7)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -119,10 +103,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_arm-cr ARM Cortex-R
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -132,10 +112,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_arm7-9 ARM7/ARM9 ("classic" ARM)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -144,10 +120,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page exa_msp430 MSP430 ("classic" MSP430 and "extended" MSP430x)
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.

View File

@ -17,10 +17,6 @@ You do **not** need to use a third-party RTOS just to achieve preemptive multita
/*##########################################################################*/
/*! @page exa_embos embOS
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
The QP/C examples for SEGGER embOS are as follows:
- ARM Cortex-M
@ -74,9 +70,6 @@ The actual COM port number might be different on your Windows machine. Please ch
/*##########################################################################*/
/*! @page exa_freertos FreeRTOS
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
The QP/C examples for FreeRTOS are as follows:
@ -231,10 +224,6 @@ copy dbg\start-stop.bin E:
/*##########################################################################*/
/*! @page exa_threadx ThreadX
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
The QP/C examples for ThreadX (Express Logic) are as follows:
- @subpage threadx_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a><br>(IAR EWARM toolchain)
@ -304,9 +293,6 @@ The actual COM port number might be different on your Windows machine. Please ch
/*##########################################################################*/
/*! @page exa_ucos-ii uC/OS-II
@htmlonly
<script src="preview.js" type="text/javascript"></script>
@endhtmlonly
The QP/C examples for uC/OS-II are as follows:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

View File

@ -1,6 +1,6 @@
/**
* @file
* @brief Command-line macros and macros for porting QP
* @brief Command-line macros and macros for porting and configuring QP
*/
/*! The preprocessor switch to disable checking assertions */
@ -34,6 +34,14 @@
*/
#define Q_UTEST
/*! The preprocessor switch to enable constructor in the ::QEvt class
* instrumentation in the code */
/**
* @tr{RQP005}
*/
#define Q_EVT_CTOR
/*! This macro defines the type of the thread handle used for AOs */
#define QF_THREAD_TYPE void*

View File

@ -93,7 +93,7 @@ QP/C is licensed under the sustainable <a class="extern" target="_blank" href="h
@subsection open-source Open Source Projects
If you are developing and distributing **open source** applications under the GNU General Public License (GPL), as published by the Free Software Foundation, then you are free to use the Quantum Leaps software under the <a class="extern" target="_blank" href="http://www.gnu.org/copyleft/gpl.html">GPL version 3</a> of the License, or (at your option) any later version. Please note that GPL requires that all modifications to the original code as well as your application code (Derivative Works as defined in the Copyright Law) must also be released under the terms of the GPL open source license.
If you are developing and distributing **open source** applications under the GNU General Public License (GPL), as published by the Free Software Foundation, then you are free to use the Quantum Leaps software under the <a class="extern" target="_blank" href="https://www.gnu.org/copyleft/gpl.html">GPL version 3</a> of the License, or (at your option) any later version. Please note that GPL requires that all modifications to the original code as well as your application code (Derivative Works as defined in the Copyright Law) must also be released under the terms of the GPL open source license.
@subsection closed-source Closed Source Projects
@ -101,7 +101,7 @@ If you are developing and distributing traditional **closed source** application
@section support How to get help?
Please post any **technical questions** to the <a class="extern" target="_blank" href="http://sourceforge.net/p/qpc/discussion/668726"><strong>Free Support Forum</strong></a> hosted on SourceForge.net. Posts to this forum benefit the whole community and are typically answered the same day.
Please post any **technical questions** to the <a class="extern" target="_blank" href="https://sourceforge.net/p/qpc/discussion/668726"><strong>Free Support Forum</strong></a> hosted on SourceForge.net. Posts to this forum benefit the whole community and are typically answered the same day.
Direct **Commercial Support** is available to the commercial licensees. Every commercial license includes one year of Technical Support for the licensed software. The support term can be extended annually.
@ -114,12 +114,9 @@ Training and consulting services are also available from Quantum Leaps. Please r
- Quantum Leaps licensing: <a class="extern" target="_blank" href="https://www.state-machine.com/licensing">state-machine.com/licensing</a>
- QP/QM on SourceForge.net: <a class="extern" target="_blank" href="https://sourceforge.net/projects/qpc">sourceforge.net/projects/qpc</a>
- QP/QM on GitHub: <a class="extern" target="_blank" href="https://github.com/QuantumLeaps">github.com/QuantumLeaps</a>
- e-mail: <a class="extern" target="_blank" href="mailto:info@state-machine.com">info@state-machine.com</a>
@next{gs}
*/

View File

@ -92,7 +92,7 @@ if "%1"=="-CHM" (
@echo Generating HTML...
%DOXYGEN% Doxyfile%1
@qclean ..\html
rem @qclean ..\html
)
@endlocal

View File

@ -1,3 +1,15 @@
/*! @defgroup qp QP
@brief
Real-Time Embedded Framework
QP Real-Time Embedded Framework (RTEF) is a reusable architecture for building real-time embedded (RTE) software as a system of collaborating, @ref srs_ed "event-driven" @ref srs_ao "Active Objects" (a.k.a. Actors).
The internal behavior of Active Objects is specified in QP by means of @ref srs_sm "Hierarchical State Machines" (UML statecharts). The QP framework supports manual coding of Hierarchical State Machines in as well as Model-Based Design (MBD) and automatic code generation.
*/
/*##########################################################################*/
/*! @defgroup qep QEP
@brief

View File

@ -1,36 +0,0 @@
/* Image preview script
* powered by jQuery (http://www.jquery.com)
* written by Alen Grakalic (http://cssglobe.com)
* for more info visit
* http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
*/
this.imagePreview = function(){
// you might want to adjust to get the right result
horOffset = -100;
verOffset = 0;
/* END CONFIG */
$("a.preview").hover(function(e){
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
$("#preview")
.css("top",(e.pageY - verOffset) + "px")
.css("left",(e.pageX + horOffset) + "px")
.fadeIn("fast");
},
function(){
this.title = this.t;
$("#preview").remove();
});
$("a.preview").mousemove(function(e){
$("#preview")
.css("top",(e.pageY - verOffset) + "px")
.css("left",(e.pageX + horOffset) + "px");
});
};
// starting the script on page load
$(document).ready(function(){
imagePreview();
});

View File

@ -1,155 +0,0 @@
/*! @page sas_toc SAS
<h1>Software Architecture Specification (SAS)</h1>
<p>This document specifies the software architecture for the **QP/C** @termref{ao} @termref{framework}. This document describes the intended features of the QP/C framework, as well as the interfaces to other software, hardware, and various other technical dependencies. The quick links to the main sections of this SRS are given below:
</p>
- @subpage sas_intro
+ @ref sas_purpose
+ @ref sas_conv
+ @ref sas_scope
+ @ref sas_audience
+ @ref sas_refs
- @subpage sas_descr
+ @ref sas_prod
+ @ref sas_funct
+ @ref sas_user
+ @ref sas_assume
- @subpage sas
+ @ref sas_fun
- @ref sas_qf
- @ref sas_qep
- @ref sas_qv
- @ref sas_qk
- @ref sas_qxk
+ @ref sas_non-fun
+ @ref sas_constr
@next{sas_intro}
*/
/*##########################################################################*/
/*! @page sas_intro Introduction
Embedded software developers from different industries are independently re-discovering patterns for building concurrent software that is safer, more responsive and easier to understand than naked threads and various blocking mechanisms of a traditional Real-Time Operating System (RTOS). These best practices universally favor event-driven, asynchronous, non-blocking, encapsulated state machines instead of naked, blocking RTOS threads.
@section sas_purpose Purpose
<p>The specification of the QP/C @termref{ao} @termref{framework} is to represent a reusable @termref{architecture}, which supports efficient implementation of the @termref{ao} model of computation for deeply embedded applications, such as single-chip microcontrollers.
</p>
<strong>QP/C</strong> (Quantum Platform in C) is a lightweight software @termref{framework, framework} for building responsive and modular real-time embedded applications as systems of cooperating, event-driven @termref{ao, active objects} (@termref{ao, actors}).
@section sas_conv Document Conventions
@subsection sas_conv_num Numbering of Requirements
@subsection sas_conv_shall Use of "Shall" and "Should"
Requirement definitions use consistent terminology to indicate whether something is mandatory or desirable. _Shall_ is used to denote **mandatory** behavior. _Should_ is used to denote a **desirable** behavior that should typically take place, but might not happen all the time or might be optional in uncommon cases.
@section sas_scope Project Scope
@section sas_audience Intended Audience
This SRS document is primarily intended for **embedded software engineers**, who develop applications based on the QP/C framework.
This SRS can be also of interest to test engineers, software architects, system engineers, quality-assurance engineers, hardware engineers, as well as managers overseeing the software development.
@section sas_refs References
@next{sas_descr}
*/
/*##########################################################################*/
/*! @page sas_descr Overall Description
@section sas_prod Product Perspective
@section sas_funct Product Functions
- @reqref{RQPC101}
- @reqref{RQPC102}
@section sas_user User Characteristics
The main users of the QP/C framework are **embedded software engineers**, who develop applications based on the QP/C framework.
@section sas_assume Assumptions and Dependencies
@next{sas}
*/
/*##########################################################################*/
/*! @page sas Architecture Elements
@section sas_fun Functional Requirements
@subsection sas_qf Active Object Framework
The software shall support hierarchical state nesting
@subsection sas_qep State Machine Event Processor
@subsection sas_qv Cooperative Run-to-Completion Kernel
@subsection sas_qk Preemptive Run-to-Completion Kernel
@subsection sas_qxk Preemptive Blocking Kernel
@section sas_non-fun Non-functional Requirements
@subsection sas_quality Software Quality Attributes
@subsection sas_perform Performance Requirements
@subsection sas_port Portability Requirements
@subsection sas_safe Safety Requirements
@subsection sas_secure Security Requirements
@section sas_constr Constraints
@subsection sas_standards Compliance with Standards
*/

View File

@ -1,157 +0,0 @@
/*! @page sds_toc SDS
<h1>Software Design Specification (SDS)</h1>
<p>This document specifies the design of the **QP/C active object framework**. This document describes the intended features of the QP/C framework, as well as the interfaces to other software, hardware, and various other technical dependencies. The quick links to the main sections of this SDS are given below:
</p>
- @subpage sds_intro
+ @ref sds_purpose
+ @ref sds_conv
+ @ref sds_scope
+ @ref sds_audience
+ @ref sds_refs
- @subpage sds_over
+ @ref sds_req
+ @ref sds_arch
- @subpage sds_viewpoints
+ @ref sds_context
+ @ref sds_composition
+ @ref sds_logical
+ @ref sds_dependency
+ @ref sds_information
+ @ref sds_use
+ @ref sds_interface
+ @ref sds_structure
+ @ref sds_interaction
+ @ref sds_state
+ @ref sds_algorithm
+ @ref sds_resource
- @subpage sds
+ @ref sds_mod
- @ref sds_qf
- @ref sds_qep
- @ref sds_qv
- @ref sds_qk
- @ref sds_qxk
@next{sds_intro}
*/
/*##########################################################################*/
/*! @page sds_intro Introduction
@section sds_purpose Purpose
<strong>QP/C</strong> (Quantum Platform in C) is a lightweight software @termref{framework, framework} for building responsive and modular real-time embedded applications as systems of cooperating, event-driven @termref{ao, active objects} (@termref{ao, actors}).
@section sds_conv Document Conventions
@subsection srs_conv_num Numbering of Requirements
@subsection srs_conv_shall Use of "Shall" and "Should"
Requirement definitions use consistent terminology to indicate whether something is mandatory or desirable. _Shall_ is used to denote **mandatory** behavior. _Should_ is used to denote a **desirable** behavior that should typically take place, but might not happen all the time or might be optional in uncommon cases.
@section sds_scope Project Scope
@section sds_audience Intended Audience
This SRS document is primarily intended for **embedded software engineers**, who develop applications based on the QP/C framework.
This SRS can be also of interest to test engineers, software architects, system engineers, quality-assurance engineers, hardware engineers, as well as managers overseeing the software development.
@section sds_refs References
@next{sds_over}
*/
/*##########################################################################*/
/*! @page sds_over Software Overview
@section sds_req Allocation of Requirements
@section sds_arch Software Architecture
@next{sds_viewpoints}
*/
/*##########################################################################*/
/*! @page sds_viewpoints Design Viewpoints
@section sds_context Context Viewpoint
@section sds_composition Composition Viewpoint
@section sds_logical Logical Viewpoint
@section sds_dependency Dependency Viewpoint
@section sds_information Information Viewpoint
@section sds_use Patterns Use Viewpoint
@section sds_interface Interface Viewpoint
@section sds_structure Structure Viewpoint
@section sds_interaction Interaction Viewpoint
@section sds_state State Dynamics Viewpoint
@section sds_algorithm Algorithm Viewpoint
@section sds_resource Resource Viewpoint
@next{sds}
*/
/*##########################################################################*/
/*! @page sds Software Module Description
@section sds_req Allocation of Requirements
@section sds_arch Software Architecture
@next{sds}
*/

View File

@ -1,13 +0,0 @@
/*! @page spec Specifications
The following documents contain specifications for the QP/C software framework.
- @subpage srs_toc (Software Requirements Specification)
- @subpage sas_toc (Software Architecture Specification)
- @subpage sds_toc (Software Design Specification, a.k.a. Software Design Description SDD)
@note
The specification documents are included as an integral part of the "QP/C Reference Manual" for bi-directional @termref{traceabilty, traceabilty} of the @ref srs_toc "requirements" to the @ref sas_toc "architecture", the @ref sds_toc "design", the <a href="files.html"><strong>code</strong></a>, and the tests. Specifically, the electronic, hyper-text format of all these documents enables creating *hyper-links*, so it possible, for example, to simply click on a hyper-link to a requirement to get to its description.
@next{srs_toc}
*/

View File

@ -1,198 +0,0 @@
/*! @page srs_toc Requirements (SRS)
<h1>Software Requirements Specification (SRS)</h1>
<p>This document specifies the requirements for the **QP/C** @termref{rtef, real-time embedded framework (RTEF)} (later referenced simply as _QP/C_). This document describes the intended features of _QP/C_, as well as the interfaces to other software, such as application-level software as well as the lower-level software providing services to QP/C. The quick links to the main sections of this SRS are given below:
</p>
- @subpage srs_intro
+ @ref srs_purpose
+ @ref srs_audience
+ @ref srs_conv
+ @ref srs_refs
+ @ref srs_assume
- @subpage srs_fun
+ @ref srs_qep
+ @ref srs_qf
+ @ref srs_qv
+ @ref srs_qk
+ @ref srs_qxk
- @subpage srs_nf
+ @ref srs_constr
- @subpage reqdef
@next{srs_intro}
*/
/*##########################################################################*/
/*! @page srs_intro Introduction
@tableofcontents
<p>Embedded software developers face many challenges, but some of the most difficult problems fall into two main categories:
</p>
- problems related to concurrency, such as execution of interrupts and tasks of a Real-Time Operating System (@termref{RTOS})
- problems related to execution logic, such as correctly choosing the right code to execute in response to a given event.
<p>The embedded software industry is in the midst of a major revolution. Tremendous amount of new development lays ahead. This new software needs an actual @termref{architecture} that is _safer_, more extensible, and easier to understand than the usual "free-threading" approach of a traditional Real-Time Operating System (@termref{RTOS}).
</p>
This document describes the requirements of the QP/C software framework, which provides such a reusable software architecture for real-time embedded (RTE) systems. This architecture is based on event-driven, asynchronous, non-blocking, encapsulated @ref srs_ao "active objects".
@section srs_purpose Purpose
The purpose of the QP/C @termref{ao} @termref{framework} is to provide a reusable software @termref{architecture} and efficient implementation of the @termref{ao} model of computation for deeply embedded applications, such as single-chip microcontrollers.
@section srs_audience Intended Audience
This SRS document is primarily intended for **embedded software engineers**, who develop applications based on the QP/C framework.
This SRS can be also of interest to test engineers, software architects, system engineers, quality-assurance engineers, hardware engineers, as well as managers overseeing the software development.
@section srs_conv Document Conventions
@subsection srs_conv_num Numbering of Requirements
@subsection srs_conv_shall Use of "Shall" and "Should"
Requirement definitions use consistent terminology to indicate whether something is mandatory or desirable. _Shall_ is used to denote **mandatory** behavior. _Should_ is used to denote a **desirable** behavior that should typically take place, but might not happen all the time or might be optional in uncommon cases.
@section srs_refs References
- @reqref{RQPC101}
- @reqref{RQPC102}
- @reqref{RQPC201}
- @reqref{RQPC202}
@section srs_assume Assumptions and Dependencies
@next{srs_fun}
*/
/*##########################################################################*/
/*! @page srs_fun Functional Requirements
@section srs_qep State Machine Event Processor (QEP)
The QP/C Event Processor (QEP) is a sub-component of the QP/C framework that implements processing of events according to state machine semantics. Specifically, according to that semantics each event is processed to completion (Run-to-Completion) before the processing of the next event can begin.
@reqdef{RQPC101} QEP shall process events according to the Run-To-Completion (RTC) semantics.
@description
RTC event processing means that a given event must be handled entirely (to completion) before processing of the next event can begin. QEP shall implement this requirement via a generic "dispatch" operation, which will process one event at at time and needs to complete (return) before it can be called again.
@rationale
RTC is the universally assumed semantics of processing events in virtually all event-driven systems. The main advantage of RTC is that it eliminates by design any concurrency hazards within a given software component.
@reqdef{RQPC102} QEP shall support multiple and interchangeable event processing strategies, including various state machine implementations.
@reqdef{RQPC103} QEP shall support hierarchical state machines with the following features:
- leaf states
- composite states
- entry actions to states
- exit actions from states
- nested initial transitions in composite states
- regular transitions between states at any level of nesting
- internal transitions in states
- guard conditions on all types of transitions
- transitions to history (shallow)
- transitions to history (deep)
@reqdef{RQPC104} The state machine implementation must be __human readable__.
@reqdef{RQPC105} The state machine implementation must be __traceable__.
@reqdef{RQPC106} The state machine implementation must be amenable to automatic code generation.
@reqdef{RQPC107} The QMsm-state machine implementation strategy shall additionally support the following features:
- submachines
- entry points
- exit points
- submachine states
@reqdef{RQPC108} The generic "dispatch" operation must not use dynamic memory.
@reqdef{RQPC109} The generic "dispatch" operation must be deterministic.
@reqdef{RQPC110} The generic "dispatch" operation must use limited and known amount of call stack.
@reqdef{RQPC111} The application-level code shall have an easy access to the instance variables via just one pointer.
@reqdef{RQPC112} The application-level code shall have an easy access to the current event via just one pointer.
@section srs_qf Active Object Framework
@section srs_qv Cooperative Run-to-Completion Kernel
@section srs_qk Preemptive Run-to-Completion Kernel
@section srs_qxk Preemptive Blocking Kernel
@next{srs_nf}
*/
/*##########################################################################*/
/*! @page srs_nf Non-Functional Requirements
@section srs_quality Software Quality Attributes
@section srs_perform Performance Requirements
@reqdef{RQPC201} The software shall support hierarchical state nesting
@amplification
State hierarchy is the primary mechanism of behavioral reuse in state machines.
@rationale
This is a useful thing to have
@section srs_port Portability Requirements
@reqdef{RQPC202}
The software shall support hierarchical state nesting
@par Amplification
The implementation must be traceable.
@section srs_safe Safety Requirements
@section srs_secure Security Requirements
@section srs_constr Constraints
@section srs_standards Compliance with Standards
@next{sas_toc}
*/

21
doxygen/subpages.dox Normal file
View File

@ -0,0 +1,21 @@
@subpage gs "&nbsp;"
@subpage srs "&nbsp;"
@subpage struct "&nbsp;"
@subpage api "&nbsp;"
@subpage exa "&nbsp;"
@subpage exa_apps "&nbsp;"
@subpage exa_native "&nbsp;"
@subpage exa_low-power "&nbsp;"
@subpage exa_rtos "&nbsp;"
@subpage exa_os "&nbsp;"
@subpage exa_qutest "&nbsp;"
@subpage exa_mware "&nbsp;"
@subpage ports "&nbsp;"
@subpage ports_native "&nbsp;"
@subpage ports_rtos "&nbsp;"
@subpage ports_os "&nbsp;"
@subpage ports_lint "&nbsp;"
@subpage traceability "&nbsp;"
@subpage history "&nbsp;"
@subpage help "&nbsp;"

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>

View File

@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -590,7 +591,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -804,6 +805,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -970,7 +972,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1209,7 +1211,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1423,6 +1425,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1589,7 +1592,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>

View File

@ -15,32 +15,36 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain.380301443" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.linkerDebug.123457069">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.964772037" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.DebugToolchain.1125048132" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.linkerDebug.29350822">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1490268376" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C123GH6PM"/>
<listOptionValue builtIn="false" value="DEVICE_CORE_ID=CORTEX_M4_0"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=tm4c123gh6pm.lds"/>
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=blinky-qv.ld"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
<listOptionValue builtIn="false" value="PRODUCTS="/>
<listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.904099521" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="GNU_6.3.1:Linaro" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.targetPlatformDebug.895530531" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.builderDebug.834922118" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.compilerDebug.861559358" name="GNU Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.CODE_STATE.326931710" name="Code state" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.CODE_STATE.THUMB" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MARCH.1627488652" name="Specify the name of the target architecture (-march)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MARCH" value="armv7e-m" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MCPU.2064354121" name="Target CPU (-mcpu)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MCPU" value="cortex-m4" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFPU.1916890427" name="Specify the name of the target floating point hardware/format (-mfpu)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFPU" value="fpv4-sp-d16" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI.315769723" name="Specify if floating point hardware should be used (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS.1495418449" name="Place each function into its own section (-ffunction-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS.1446118351" name="Place data items into their own section (-fdata-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE.865670737" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1294949152" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="GNU_10.3.1" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.targetPlatformDebug.1124893726" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.builderDebug.1231431617" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.compilerDebug.447918988" name="GNU Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.CODE_STATE.1806056854" name="Code state" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.CODE_STATE.THUMB" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MARCH.401154340" name="Target architecture (-march)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MARCH" value="armv7e-m" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MCPU.1571454910" name="Target CPU (-mcpu)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MCPU" value="cortex-m4" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MFPU.547036248" name="Target floating point hardware/format (-mfpu)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MFPU" value="fpv4-sp-d16" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MFLOAT_ABI.201286862" name="Use floating point hardware (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.FUNCTION_SECTIONS.2126122706" name="Place each function into its own section (-ffunction-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.FUNCTION_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DATA_SECTIONS.788158579" name="Place data items into their own section (-fdata-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DATA_SECTIONS" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DEFINE.2092563348" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="TARGET_IS_TM4C123_RB1"/>
<listOptionValue builtIn="false" value="PART_TM4C123GH6PM"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH.974128893" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH" valueType="includePath">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.INCLUDE_PATH.770117038" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../.."/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../src"/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../include"/>
@ -49,34 +53,34 @@
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../3rd_party/CMSIS/Include"/>
<listOptionValue builtIn="false" value="${CG_TOOL_INCLUDE_PATH}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEBUG.882013544" name="Generate debug information (-g)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEBUG" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.433735214" name="Generate debug information in DWARF version (-gdwarf-)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF.1684136090" name="Do not emit DWARF additions beyond selected version (-gstrict-dwarf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS.1704724465" name="Override built-in specs with the contents of the specified file (-specs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS" value="&quot;nosys.specs&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS.1586473819" name="Assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DEBUG.1917762872" name="Generate debug information (-g)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DEBUG" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DWARF_VERSION.570325744" name="Generate debug information in DWARF version (-gdwarf-)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.DWARF_VERSION.3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.STRICT_DWARF.1212622853" name="Do not emit DWARF additions beyond selected version (-gstrict-dwarf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.STRICT_DWARF" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.SPECS.1006296811" name="Override built-in specs with the contents of the specified file (-specs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.SPECS" value="&quot;nosys.specs&quot;" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.ASM_SPECIFIC_FLAGS.687894881" name="Miscellaneous assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<listOptionValue builtIn="false" value="-x assembler-with-cpp"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS.572364895" name="Other assembler flags (-Xassembler)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__C_SRCS.914425103" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__CPP_SRCS.1969735213" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__ASM_SRCS.1435568092" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__ASM2_SRCS.941675283" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compiler.inputType__ASM2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__C_SRCS.410874657" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__CPP_SRCS.865106774" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__ASM_SRCS.1331065141" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__ASM2_SRCS.722567508" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.linkerDebug.123457069" name="GNU Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.OUTPUT_FILE.839981367" name="Output file (-o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.MAP_FILE.1555000467" name="Write a map file (-Map)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.LIBRARY.1347913029" name="Libraries (-l, --library)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.LIBRARY"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.SCRIPTS.933040553" name="Linker command files (-T, --script)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.SCRIPTS"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NOSTARTFILES.879149092" name="Do not use the standard system startup files when linking (-nostartfiles)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NOSTARTFILES" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NODEFAULTLIBS.718462702" name="Do not use the standard system libraries when linking (-nodefaultlibs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NODEFAULTLIBS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.GC_SECTIONS.842383496" name="Remove unused sections (--gc-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.GC_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.STATIC.869793521" name="Do not link with the shared libraries (-static)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.STATIC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NOSTDLIB.255196952" name="Do not use the standard system startup files or libraries when linking (-nostdlib)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.linkerID.NOSTDLIB" value="true" valueType="boolean"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__CMD_SRCS.677089481" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__CMD2_SRCS.1897887025" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__GEN_CMDS.1685978282" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exeLinker.inputType__GEN_CMDS"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.linkerDebug.29350822" name="GNU Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.OUTPUT_FILE.1804521702" name="Output file (-o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.MAP_FILE.1758629417" name="Write a map file (-Map)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NOSTARTFILES.1113933490" name="Do not use the standard system startup files when linking (-nostartfiles)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NOSTARTFILES" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NODEFAULTLIBS.195941908" name="Do not use the standard system libraries when linking (-nodefaultlibs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NODEFAULTLIBS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NOSTDLIB.1823752810" name="Do not use the standard system startup files or libraries when linking (-nostdlib)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.NOSTDLIB" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.STATIC.1459644670" name="Do not link with the shared libraries (-static)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.STATIC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.GC_SECTIONS.580201623" name="Remove unused sections (--gc-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.GC_SECTIONS" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.LIBRARY.10220823" name="Libraries (-l, --library)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="c"/>
</option>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__CMD_SRCS.494517408" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__CMD2_SRCS.817088504" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__GEN_CMDS.1797473774" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.hex.591401063" name="GNU Objcopy Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.hex"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.hex.1293390426" name="GNU Objcopy Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_10.0.hex"/>
</toolChain>
</folderInfo>
<sourceEntries>
@ -101,7 +105,7 @@
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546.1358541448" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546.1358541448." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain.469823560" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.linkerDebug.123457069">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1846983527" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1846983527" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C123GH6PM"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@ -121,12 +125,12 @@
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI.801715358" name="Specify if floating point hardware should be used (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS.878443810" name="Place each function into its own section (-ffunction-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS.1031205950" name="Place data items into their own section (-fdata-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE.411887178" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE" valueType="definedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE.411887178" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="NDEBUG"/>
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="TARGET_IS_TM4C123_RB1"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH.254795141" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH" valueType="includePath">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH.254795141" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../.."/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../src"/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../include"/>
@ -139,7 +143,7 @@
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.2113079762" name="Generate debug information in DWARF version (-gdwarf-)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF.550208473" name="Do not emit DWARF additions beyond selected version (-gstrict-dwarf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS.341010137" name="Override built-in specs with the contents of the specified file (-specs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS" value="&quot;nosys.specs&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS.1061535145" name="Assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS.1061535145" name="Assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<listOptionValue builtIn="false" value="-x assembler-with-cpp"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS.896297329" name="Other assembler flags (-Xassembler)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS"/>
@ -188,7 +192,7 @@
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546.866474468" name="Spy" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.534492546.866474468." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain.359806358" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.exe.linkerDebug.123457069">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.660671075" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.660671075" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C123GH6PM"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@ -208,12 +212,12 @@
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI.1744472368" name="Specify if floating point hardware should be used (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS.1660812699" name="Place each function into its own section (-ffunction-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.FUNCTION_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS.124857598" name="Place data items into their own section (-fdata-sections)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DATA_SECTIONS" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE.1992174521" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE" valueType="definedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE.1992174521" name="Define symbols (-D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="Q_SPY"/>
<listOptionValue builtIn="false" value="__FPU_PRESENT"/>
<listOptionValue builtIn="false" value="TARGET_IS_TM4C123_RB1"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH.600879111" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH" valueType="includePath">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH.600879111" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../.."/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../src"/>
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../../../../include"/>
@ -226,7 +230,7 @@
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.1848505569" name="Generate debug information in DWARF version (-gdwarf-)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.DWARF_VERSION.3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF.811406117" name="Do not emit DWARF additions beyond selected version (-gstrict-dwarf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.STRICT_DWARF" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS.608092404" name="Override built-in specs with the contents of the specified file (-specs)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.SPECS" value="&quot;nosys.specs&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS.582350639" name="Assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS.582350639" name="Assembly source specific flags" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.ASM_SPECIFIC_FLAGS" valueType="stringList">
<listOptionValue builtIn="false" value="-x assembler-with-cpp"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS.2100120891" name="Other assembler flags (-Xassembler)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_6.0.compilerID.OTHER_ASM_FLAGS"/>
@ -274,4 +278,5 @@
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
</project-mappings>
</storageModule>
</cproject>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>

View File

@ -28,8 +28,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact information:
* Web : http://www.state-machine.com
* Email: info@state-machine.com
* https://www.state-machine.com
* mailto:info@state-machine.com
*****************************************************************************/
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)

View File

@ -1,7 +1,7 @@
/*****************************************************************************
* Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QXK kernel
* Last updated for version 6.9.4
* Last updated on 2021-08-04
* Product: DPP example, NUCLEO-L053R8 board, preemptive QXK kernel
* Last updated for version 6.9.3
* Last updated on 2021-03-03
*
* Q u a n t u m L e a P s
* ------------------------
@ -55,7 +55,6 @@ static uint32_t l_rnd; /* random seed */
/* QSpy source IDs */
static QSpyId const l_SysTick_Handler = { 0U };
static QSpyId const l_EXTI0_1_IRQHandler = { 0U };
enum AppRecords { /* application-specific trace records */
PHILO_STAT = QS_USER
@ -119,7 +118,7 @@ void SysTick_Handler(void) { /* system clock tick ISR */
void EXTI0_1_IRQHandler(void) {
static QEvt const testEvt = { TEST_SIG, 0U, 0U };
QXK_ISR_ENTRY(); /* inform QXK about entering an ISR */
QXTHREAD_POST_X(XT_Test2, &testEvt, 0U, &l_EXTI0_1_IRQHandler);
QXTHREAD_POST_X(XT_Test2, &testEvt, 0U, (void *)0);
QXK_ISR_EXIT(); /* inform QXK about exiting an ISR */
}
/*..........................................................................*/
@ -168,7 +167,6 @@ void BSP_init(void) {
Q_ERROR();
}
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
QS_OBJ_DICTIONARY(&l_EXTI0_1_IRQHandler);
QS_USR_DICTIONARY(PHILO_STAT);
/* setup the QS filters... */

View File

@ -110,7 +110,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -253,7 +253,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,320 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_blinky
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
bsp.c \
blinky.c \
test_blinky.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -106,7 +106,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -112,7 +112,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -255,7 +255,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,322 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_dpp
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
test_dpp.c \
main.c \
philo.c \
table.c \
bsp.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)\$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -108,7 +108,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -106,7 +106,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -105,7 +105,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -109,7 +109,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -252,7 +252,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,319 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qhsmtst
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
qhsmtst.c \
test_qhsm.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)\$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -105,7 +105,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -109,7 +109,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -252,7 +252,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,319 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qmsmtst
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
qmsmtst.c \
test_qmsm.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)\$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -105,7 +105,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -108,7 +108,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -251,7 +251,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,318 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_qutest
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
test_qutest.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)\$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -104,7 +104,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -0,0 +1,210 @@
-: 0:Source:test_qutest.c
-: 0:Graph:build\test_qutest.gcno
-: 0:Data:build\test_qutest.gcda
-: 0:Runs:9
-: 1:/*****************************************************************************
-: 2:* Purpose: Fixture for QUTEST self-test
-: 3:* Last Updated for Version: 6.9.3
-: 4:* Date of the Last Update: 2021-05-31
-: 5:*
-: 6:* Q u a n t u m L e a P s
-: 7:* ------------------------
-: 8:* Modern Embedded Software
-: 9:*
-: 10:* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
-: 11:*
-: 12:* This program is open source software: you can redistribute it and/or
-: 13:* modify it under the terms of the GNU General Public License as published
-: 14:* by the Free Software Foundation, either version 3 of the License, or
-: 15:* (at your option) any later version.
-: 16:*
-: 17:* Alternatively, this program may be distributed and modified under the
-: 18:* terms of Quantum Leaps commercial licenses, which expressly supersede
-: 19:* the GNU General Public License and are specifically designed for
-: 20:* licensees interested in retaining the proprietary status of their code.
-: 21:*
-: 22:* This program is distributed in the hope that it will be useful,
-: 23:* but WITHOUT ANY WARRANTY; without even the implied warranty of
-: 24:* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-: 25:* GNU General Public License for more details.
-: 26:*
-: 27:* You should have received a copy of the GNU General Public License
-: 28:* along with this program. If not, see <www.gnu.org/licenses>.
-: 29:*
-: 30:* Contact information:
-: 31:* <www.state-machine.com/licensing>
-: 32:* <info@state-machine.com>
-: 33:*****************************************************************************/
-: 34:#include "qpc.h" /* for QUTEST */
-: 35:
-: 36:Q_DEFINE_THIS_MODULE("test_qutest")
-: 37:
-: 38:/*--------------------------------------------------------------------------*/
-: 39:static uint8_t buffer[100];
-: 40:static uint32_t myFun(void);
-: 41:
-: 42:enum {
-: 43: FIXTURE_SETUP = QS_USER,
-: 44: FIXTURE_TEARDOWN,
-: 45: COMMAND_A,
-: 46: COMMAND_B,
-: 47: COMMAND_X,
-: 48: COMMAND_Y,
-: 49: COMMAND_Z,
-: 50: MY_RECORD,
-: 51:};
-: 52:
-: 53:/*--------------------------------------------------------------------------*/
9: 54:int main(int argc, char *argv[]) {
-: 55:
9: 56: QF_init(); /* initialize the framework */
9: 56-block 0
-: 57:
-: 58: /* initialize the QS software tracing */
9*: 59: Q_ALLEGE(QS_INIT(argc > 1 ? argv[1] : (void *)0));
9: 59-block 0
9: 59-block 1
%%%%%: 59-block 2
-: 60:
-: 61: /* global filter */
9: 62: QS_GLB_FILTER(QS_ALL_RECORDS); /* enable all QS records */
9: 62-block 0
-: 63:
-: 64: /* dictionaries... */
9: 65: QS_OBJ_DICTIONARY(buffer);
9: 66: QS_FUN_DICTIONARY(&myFun);
-: 67:
9: 68: QS_USR_DICTIONARY(FIXTURE_SETUP);
9: 69: QS_USR_DICTIONARY(FIXTURE_TEARDOWN);
9: 70: QS_USR_DICTIONARY(COMMAND_A);
9: 71: QS_USR_DICTIONARY(COMMAND_B);
9: 72: QS_USR_DICTIONARY(COMMAND_X);
9: 73: QS_USR_DICTIONARY(COMMAND_Y);
9: 74: QS_USR_DICTIONARY(COMMAND_Z);
9: 75: QS_USR_DICTIONARY(MY_RECORD);
-: 76:
9: 77: return QF_run(); /* run the tests */
-: 78:}
-: 79:
-: 80:/*--------------------------------------------------------------------------*/
12: 81:void QS_onTestSetup(void) {
12: 82: QS_BEGIN_ID(FIXTURE_SETUP, 0U)
12: 82-block 0
12: 82-block 1
12: 82-block 2
12: 83: QS_END()
12: 84:}
-: 85:/*..........................................................................*/
12: 86:void QS_onTestTeardown(void) {
12: 87: QS_BEGIN_ID(FIXTURE_TEARDOWN, 0U)
12: 87-block 0
12: 87-block 1
12: 87-block 2
12: 88: QS_END()
12: 89:}
-: 90:
-: 91:/*..........................................................................*/
-: 92:/*! callback function to execute user commands */
14: 93:void QS_onCommand(uint8_t cmdId,
-: 94: uint32_t param1, uint32_t param2, uint32_t param3)
-: 95:{
14: 96: (void)param1;
14: 97: (void)param2;
14: 98: (void)param3;
-: 99:
14: 100: switch (cmdId) {
14: 100-block 0
2: 101: case COMMAND_A: {
2: 102: Q_ASSERT_ID(100, param1 != 0U);
2: 102-block 0
1: 102-block 1
1: 103: QS_BEGIN_ID(COMMAND_A, 0U) /* app-specific record */
1: 103-block 0
1: 103-block 1
1: 103-block 2
1: 104: QS_U32(0, param1);
1: 105: QS_END()
-: 106: break;
-: 107: }
1: 108: case COMMAND_B: {
1: 109: QS_BEGIN_ID(COMMAND_B, 0U) /* app-specific record */
1: 109-block 0
1: 109-block 1
1: 109-block 2
1: 110: QS_U8(0, param1);
1: 111: QS_STR("BAR");
1: 112: QS_U16(0, param2);
1: 113: QS_STR("FOO");
1: 114: QS_U32(0, param3);
1: 115: QS_F64(param1, -6.02214076E23);
1: 116: QS_END()
-: 117: break;
-: 118: }
7: 119: case COMMAND_X: {
7: 120: uint32_t x = myFun();
7: 120-block 0
7: 121: QS_BEGIN_ID(COMMAND_X, 0U) /* app-specific record */
7: 121-block 0
7: 121-block 1
7: 122: QS_U32(0, x);
-: 123: /* ... */
7: 124: QS_END()
-: 125: break;
-: 126: }
2: 127: case COMMAND_Y: {
2: 128: QS_BEGIN_ID(COMMAND_Y, 0U) /* application-specific record */
2: 128-block 0
2: 128-block 1
2: 128-block 2
2: 129: QS_FUN(&myFun);
2: 130: QS_MEM(buffer, param1);
2: 131: QS_STR((char const *)&buffer[33]);
2: 132: QS_END()
-: 133: break;
-: 134: }
2: 135: case COMMAND_Z: {
2: 136: float32_t f32 = (float32_t)((int32_t)param2/(float32_t)param3);
2: 137: float64_t f64 = -6.02214076E23;
2: 138: QS_BEGIN_ID(COMMAND_Z, 0U) /* app-specific record */
2: 138-block 0
2: 138-block 1
2: 138-block 2
2: 139: QS_F32(param1, f32);
2: 140: QS_F64(param1, f64);
2: 141: QS_END()
-: 142: break;
-: 143: }
-: 144: default:
-: 145: break;
-: 146: }
13: 147:}
-: 148:
-: 149:/*..........................................................................*/
-: 150:/* host callback function to "massage" the event, if necessary */
#####: 151:void QS_onTestEvt(QEvt *e) {
#####: 152: (void)e;
-: 153:#ifdef Q_HOST /* is this test compiled for a desktop Host computer? */
-: 154:#else /* this test is compiled for an embedded Target system */
-: 155:#endif
#####: 156:}
-: 157:/*..........................................................................*/
-: 158:/*! callback function to output the posted QP events (not used here) */
#####: 159:void QS_onTestPost(void const *sender, QActive *recipient,
-: 160: QEvt const *e, bool status)
-: 161:{
#####: 162: (void)sender;
#####: 163: (void)recipient;
#####: 164: (void)e;
#####: 165: (void)status;
#####: 166:}
-: 167:
-: 168:/*--------------------------------------------------------------------------*/
7: 169:static uint32_t myFun(void) {
7: 170: QS_TEST_PROBE_DEF(&myFun)
7: 170-block 0
7: 171: QS_TEST_PROBE(
-: 172: return qs_tp_;
-: 173: )
-: 174: return 0;
-: 175:}
-: 176:

View File

@ -0,0 +1,172 @@
/*****************************************************************************
* Product: QUTEST port for NUCLEO-L053R8 board
* Last updated for version 6.9.3
* Last updated on 2021-12-01
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <www.gnu.org/licenses/>.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*****************************************************************************/
#ifndef Q_SPY
#error "Q_SPY must be defined to compile qutest_port.c"
#endif /* Q_SPY */
#define QP_IMPL /* this is QP implementation */
#include "qf_port.h" /* QF port */
#include "qassert.h" /* QP embedded systems-friendly assertions */
#include "qs_port.h" /* QS port */
#include "qs_pkg.h" /* QS package-scope interface */
#include "stm32l0xx.h" /* CMSIS-compliant header file for the MCU used */
/* add other drivers if necessary... */
//Q_DEFINE_THIS_MODULE("qutest_port")
/* ISRs defined in this BSP ------------------------------------------------*/
void USART2_IRQHandler(void);
/* Local-scope defines -----------------------------------------------------*/
/* LED pins available on the board (just one user LED LD2--Green on PA.5) */
#define LED_LD2 (1U << 5)
/* Button pins available on the board (just one user Button B1 on PC.13) */
#define BTN_B1 (1U << 13)
#define __DIV(__PCLK, __BAUD) (((__PCLK / 4) *25)/(__BAUD))
#define __DIVMANT(__PCLK, __BAUD) (__DIV(__PCLK, __BAUD)/100)
#define __DIVFRAQ(__PCLK, __BAUD) \
(((__DIV(__PCLK, __BAUD) - (__DIVMANT(__PCLK, __BAUD) * 100)) \
* 16 + 50) / 100)
#define __USART_BRR(__PCLK, __BAUD) \
((__DIVMANT(__PCLK, __BAUD) << 4)|(__DIVFRAQ(__PCLK, __BAUD) & 0x0F))
/*..........................................................................*/
/*
* ISR for receiving bytes from the QSPY Back-End
* NOTE: This ISR is "QF-unaware" meaning that it does not interact with
* the QF/QK and is not disabled. Such ISRs don't need to call QK_ISR_ENTRY/
* QK_ISR_EXIT and they cannot post or publish events.
*/
void USART2_IRQHandler(void) { /* used in QS-RX (kernel UNAWARE interrutp) */
/* is RX register NOT empty? */
if ((USART2->ISR & (1U << 5)) != 0) {
uint32_t b = USART2->RDR;
QS_RX_PUT(b);
}
}
/* QS callbacks ============================================================*/
uint8_t QS_onStartup(void const *arg) {
static uint8_t qsBuf[2*1024]; /* buffer for Quantum Spy */
static uint8_t qsRxBuf[128]; /* buffer for QS-RX channel */
(void)arg; /* avoid the "unused parameter" compiler warning */
QS_initBuf(qsBuf, sizeof(qsBuf));
QS_rxInitBuf(qsRxBuf, sizeof(qsRxBuf));
/* NOTE: SystemInit() already called from the startup code
* but SystemCoreClock needs to be updated
*/
SystemCoreClockUpdate();
/* enable peripheral clock for USART2 */
RCC->IOPENR |= ( 1U << 0); /* Enable GPIOA clock */
RCC->APB1ENR |= ( 1U << 17); /* Enable USART#2 clock */
/* Configure PA3 to USART2_RX, PA2 to USART2_TX */
GPIOA->AFR[0] &= ~((15U << 4* 3) | (15U << 4* 2) );
GPIOA->AFR[0] |= (( 4U << 4* 3) | ( 4U << 4* 2) );
GPIOA->MODER &= ~(( 3U << 2* 3) | ( 3U << 2* 2) );
GPIOA->MODER |= (( 2U << 2* 3) | ( 2U << 2* 2) );
USART2->BRR = __USART_BRR(SystemCoreClock, 115200U); /* baud rate */
USART2->CR3 = 0x0000 | /* no flow control */
(1U << 12); /* disable overrun detection (OVRDIS) */
USART2->CR2 = 0x0000; /* 1 stop bit */
USART2->CR1 = ((1U << 2) | /* enable RX */
(1U << 3) | /* enable TX */
(1U << 5) | /* enable RX interrupt */
(0U << 12) | /* 8 data bits */
(0U << 28) | /* 8 data bits */
(1U << 0) ); /* enable USART */
/* explicitly set NVIC priorities of all Cortex-M interrupts used */
NVIC_SetPriorityGrouping(0U);
NVIC_SetPriority(USART2_IRQn, 0U); /* kernel UNAWARE interrupt */
/* enable the UART RX interrupt... */
NVIC_EnableIRQ(USART2_IRQn); /* UART2 interrupt used for QS-RX */
return 1U; /* return success */
}
/*..........................................................................*/
void QS_onCleanup(void) {
}
/*..........................................................................*/
void QS_onFlush(void) {
uint16_t b;
while ((b = QS_getByte()) != QS_EOD) { /* while not End-Of-Data... */
while ((USART2->ISR & (1U << 7)) == 0U) { /* while TXE not empty */
}
USART2->TDR = (b & 0xFFU); /* put into the DR register */
}
}
/*..........................................................................*/
/*! callback function to reset the target (to be implemented in the BSP) */
void QS_onReset(void) {
NVIC_SystemReset();
}
/*..........................................................................*/
void QS_onTestLoop() {
QS_rxPriv_.inTestLoop = true;
while (QS_rxPriv_.inTestLoop) {
/* toggle an LED on and then off (not enough LEDs, see NOTE02) */
GPIOA->BSRR |= (LED_LD2); /* turn LED[n] on */
GPIOA->BSRR |= (LED_LD2 << 16); /* turn LED[n] off */
QS_rxParse(); /* parse all the received bytes */
if ((USART2->ISR & (1U << 7)) != 0) { /* is TXE empty? */
uint16_t b;
QF_INT_DISABLE();
b = QS_getByte();
QF_INT_ENABLE();
if (b != QS_EOD) { /* not End-Of-Data? */
USART2->TDR = (b & 0xFFU); /* put into the DR register */
}
}
}
/* set inTestLoop to true in case calls to QS_onTestLoop() nest,
* which can happen through the calls to QS_TEST_PAUSE().
*/
QS_rxPriv_.inTestLoop = true;
}

View File

@ -0,0 +1,139 @@
/*****************************************************************************
* Product: Linker script for for STM32L053R8, GNU-ARM linker
* Last Updated for Version: 5.9.8
* Date of the Last Update: 2017-09-13
*
* Q u a n t u m L e a P s
* ---------------------------
* innovating embedded systems
*
* Copyright (C) Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact information:
* https://state-machine.com
* mailto:info@state-machine.com
*****************************************************************************/
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(Reset_Handler) /* entry Point */
MEMORY { /* memory map of STM32L053R8 */
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
}
/* The size of the stack used by the application. NOTE: you need to adjust */
STACK_SIZE = 1024;
/* The size of the heap used by the application. NOTE: you need to adjust */
HEAP_SIZE = 0;
SECTIONS {
.isr_vector : { /* the vector table goes FIRST into ROM */
KEEP(*(.isr_vector)) /* vector table */
. = ALIGN(4);
} >ROM
.text : { /* code and constants */
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} >ROM
.preinit_array : {
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >ROM
.init_array : {
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >ROM
.fini_array : {
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array*))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
} >ROM
_etext = .; /* global symbols at end of code */
.stack : {
__stack_start__ = .;
. = . + STACK_SIZE;
. = ALIGN(4);
__stack_end__ = .;
} >RAM
.data : AT (_etext) {
__data_load = LOADADDR (.data);
__data_start = .;
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
__data_end__ = .;
_edata = __data_end__;
} >RAM
.bss : {
__bss_start__ = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = .;
} >RAM
__exidx_start = .;
.ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >RAM
__exidx_end = .;
PROVIDE ( end = _ebss );
PROVIDE ( _end = _ebss );
PROVIDE ( __end__ = _ebss );
.heap : {
__heap_start__ = .;
. = . + HEAP_SIZE;
. = ALIGN(4);
__heap_end__ = .;
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ : {
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
}

View File

@ -109,7 +109,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -252,7 +252,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,319 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_basic
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
ProductionCode.c \
test_ProductionCode.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -105,7 +105,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -110,7 +110,7 @@ C_SRCS := \
em_usart.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
@ -168,7 +168,7 @@ endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-g++
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
@ -253,7 +253,6 @@ endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(FLASH) $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o

View File

@ -0,0 +1,320 @@
##############################################################################
# Product: Makefile for QP/C on NUCLEO-L053R8 board, QUTEST, GNU-ARM
# Last Updated for Version: 6.9.4
# Date of the Last Update: 2021-12-01
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alternatively, this program may be distributed and modified under the
# terms of Quantum Leaps commercial licenses, which expressly supersede
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses>.
#
# Contact information:
# <www.state-machine.com/licensing>
# <info@state-machine.com>
##############################################################################
#
# examples of invoking this Makefile:
# make -f make_nucleo-l053r8 USB=e: # make, uplaod to USB drive, run the tests
# make -f make_nucleo-l053r8 USB=f: TESTS=philo*.py # make and run the selected tests
# make -f make_nucleo-l053r8 HOST=localhost:7705 # connect to host:port
# make -f make_nucleo-l053r8 norun # only make but not run the tests
# make -f make_nucleo-l053r8 clean # cleanup the build
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the QTools collection for Windows, see:
# https://github.com/QuantumLeaps/qtools
#
#-----------------------------------------------------------------------------
# project name, target name, target directory:
#
PROJECT := test_mock
TARGET := nucleo-l053r8
TARGET_DIR := ..\..\target_nucleo-l053r8
#-----------------------------------------------------------------------------
# project directories:
#
# location of the QP/C framework (if not provided in an env. variable)
ifeq ($(QPC),)
QPC := ../../../..
endif
# QP port used in this project
QP_PORT_DIR := $(QPC)/ports/arm-cm/qutest
# make sure that QTOOLS env. variable is defined...
ifeq ("$(wildcard $(QTOOLS))","")
$(error QTOOLS not found. Please install QTools and define QTOOLS env. variable)
endif
# list of all source directories used by this project
VPATH := . \
../src \
$(TARGET_DIR) \
$(QPC)/src/qf \
$(QPC)/src/qs \
$(QP_PORT_DIR) \
$(QPC)/3rd_party/nucleo-l053r8 \
$(QPC)/3rd_party/nucleo-l053r8/gnu
# list of all include directories needed by this project
INCLUDES = -I. \
-I../src \
-I$(TARGET_DIR) \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/nucleo-l053r8
#-----------------------------------------------------------------------------
# project files:
#
# assembler source files
ASM_SRCS :=
# C source files
C_SRCS := \
LedBar.c \
spy_Led.c \
test_LedBar.c \
system_stm32l0xx.c \
startup_stm32l053xx.c
# C++ source files
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld
QP_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
qs.c \
qs_64bit.c \
qs_rx.c \
qs_fp.c \
qutest.c \
qutest_port.c
QP_ASMS :=
LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
# ARM_FPU: [ | vfp]
# FLOAT_ABI: [ | soft | softfp | hard]
#
ARM_CPU := -mcpu=cortex-m0plus
ARM_FPU :=
FLOAT_ABI :=
#-----------------------------------------------------------------------------
# GNU-ARM toolset (NOTE: You need to adjust to your machine)
# see https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
#
ifeq ($(GNU_ARM),)
GNU_ARM := $(QTOOLS)/gnu_arm-none-eabi
endif
# make sure that the GNU-ARM toolset exists...
ifeq ("$(wildcard $(GNU_ARM))","")
$(error GNU_ARM toolset not found. Please adjust the Makefile)
endif
CC := $(GNU_ARM)/bin/arm-none-eabi-gcc
CPP := $(GNU_ARM)/bin/arm-none-eabi-g++
AS := $(GNU_ARM)/bin/arm-none-eabi-as
LINK := $(GNU_ARM)/bin/arm-none-eabi-gcc
BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
#-----------------------------------------------------------------------------
# NOTE: The following symbol USB assumes that the NUCLEO board
# has enumerated as USB drive f:
#
ifeq ($(USB),)
USB := f:
endif
##############################################################################
# Typically you should not need to change anything below this line
# basic utilities (included in QTools for Windows), see:
# https://www.state-machine.com/qtools
MKDIR := mkdir
RM := rm
CP := cp
SLEEP := sleep
#-----------------------------------------------------------------------------
# QUTest test script utilities (requires QTOOLS):
#
ifeq ("$(wildcard $(QUTEST))","")
QUTEST := python3 $(QTOOLS)/qutest/qutest.py
endif
TESTS := *.py
#-----------------------------------------------------------------------------
# build options
#
# combine all the soruces...
C_SRCS += $(QP_SRCS)
ASM_SRCS += $(QP_ASMS)
BIN_DIR := build_$(TARGET)
ASFLAGS = -g $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
CFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
CPPFLAGS = -c -g $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb -Wall \
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
-O $(INCLUDES) $(DEFINES) -DQ_SPY -DQ_UTEST
LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
-specs=nosys.specs -specs=nano.specs \
-Wl,-Map,$(BIN_DIR)/$(OUTPUT).map,--cref,--gc-sections $(LIB_DIRS)
ASM_OBJS := $(patsubst %.s,%.o, $(notdir $(ASM_SRCS)))
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
TARGET_BIN := $(BIN_DIR)/$(OUTPUT).bin
TARGET_ELF := $(BIN_DIR)/$(OUTPUT).elf
ASM_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(ASM_OBJS))
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
C_DEPS_EXT := $(patsubst %.o, %.d, $(C_OBJS_EXT))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
CPP_DEPS_EXT := $(patsubst %.o, %.d, $(CPP_OBJS_EXT))
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
#-----------------------------------------------------------------------------
# rules
#
.PHONY : run norun flash
ifeq ($(MAKECMDGOALS),norun)
all : $(TARGET_BIN)
norun : all
else
all : $(TARGET_BIN) run
endif
$(TARGET_BIN) : $(TARGET_ELF)
$(BIN) -O binary $< $@
$(TARGET_ELF) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(CC) $(CFLAGS) $(QPC)/include/qstamp.c -o $(BIN_DIR)/qstamp.o
$(LINK) $(LINKFLAGS) -o $@ $^ $(BIN_DIR)/qstamp.o $(LIBS)
flash :
$(CP) $(TARGET_BIN) $(USB)
run : $(TARGET_BIN)
$(CP) $< $(USB)
$(SLEEP) 2
$(QUTEST) $(TESTS) $(TARGET_EXE) $(HOST)
$(BIN_DIR)/%.d : %.c
$(CC) -MM -MT $(@:.d=.o) $(CFLAGS) $< > $@
$(BIN_DIR)/%.d : %.cpp
$(CPP) -MM -MT $(@:.d=.o) $(CPPFLAGS) $< > $@
$(BIN_DIR)/%.o : %.s
$(AS) $(ASFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) $< -o $@
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) $< -o $@
.PHONY : clean show
# include dependency files only if our goal depends on their existence
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),show)
-include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
endif
endif
clean :
-$(RM) $(BIN_DIR)/*.o \
$(BIN_DIR)/*.d \
$(BIN_DIR)/*.bin \
$(BIN_DIR)/*.elf \
$(BIN_DIR)/*.map
show :
@echo PROJECT = $(PROJECT)
@echo TESTS = $(TESTS)
@echo TARGET_ELF = $(TARGET_ELF)
@echo CONF = $(CONF)
@echo VPATH = $(VPATH)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo ASM_SRCS = $(ASM_SRCS)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
@echo ASM_OBJS_EXT = $(ASM_OBJS_EXT)
@echo LIB_DIRS = $(LIB_DIRS)
@echo LIBS = $(LIBS)
@echo DEFINES = $(DEFINES)
@echo QTOOLS = $(QTOOLS)
@echo HOST = $(HOST)
@echo QUTEST = $(QUTEST)
@echo TESTS = $(TESTS)

View File

@ -106,7 +106,7 @@ C_SRCS := \
startup_TM4C123GH6PM.c
# C++ source files
CPP_SRCS :=
CPP_SRCS :=
OUTPUT := $(PROJECT)
LD_SCRIPT := $(TARGET_DIR)/test.ld

View File

@ -1,13 +1,13 @@
/*****************************************************************************
* Product: DPP example, EK-TM4C123GXL board, ThreadX kernel
* Last updated for version 6.9.1
* Last updated on 2020-09-22
* Last updated for version 6.9.4
* Last updated on 2021-12-03
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@ -72,10 +72,8 @@ static TX_TIMER l_tick_timer; /* ThreadX timer to call QF_TICK_X() */
COMMAND_STAT
};
/* ThreadX thread and thread function for QS output, see NOTE1 */
static TX_THREAD l_qs_output_thread;
static void qs_thread_function(ULONG thread_input);
static ULONG qs_thread_stkSto[64];
/* QSpy source IDs */
static QSpyId const l_clock_tick = { QS_AP_ID };
#endif
/* ISRs used in the application ==========================================*/
@ -180,7 +178,18 @@ void BSP_terminate(int16_t result) {
}
#ifdef Q_SPY
/* ThreadX "idle" thread for QS output, see NOTE1 */
static TX_THREAD idle_thread;
static void idle_thread_fun(ULONG thread_input);
static ULONG idle_thread_stack[64];
#endif
/* QF callbacks ============================================================*/
static VOID timer_expiration(ULONG id) {
QF_TICK_X(id, &l_clock_tick); /* perform the QF clock tick processing */
}
/*..........................................................................*/
void QF_onStartup(void) {
/*
* NOTE:
@ -194,8 +203,8 @@ void QF_onStartup(void) {
* or from active object(s).
*/
Q_ALLEGE(tx_timer_create(&l_tick_timer, /* ThreadX timer object */
(CHAR *)"QF_TICK", /* name of the timer */
(VOID (*)(ULONG))&QF_tickX_, /* expiration function */
(CHAR *)"QP-tick", /* name of the timer */
&timer_expiration, /* expiration function */
0U, /* expiration function input (tick rate) */
1U, /* initial ticks */
1U, /* reschedule ticks */
@ -205,15 +214,15 @@ void QF_onStartup(void) {
#ifdef Q_SPY
NVIC_EnableIRQ(UART0_IRQn); /* UART0 interrupt used for QS-RX */
/* start a ThreadX timer to perform QS output. See NOTE1... */
Q_ALLEGE(tx_thread_create(&l_qs_output_thread, /* thread control block */
(CHAR *)"QS_TX", /* thread name */
&qs_thread_function, /* thread function */
0UL, /* thread input (unsued) */
qs_thread_stkSto, /* stack start */
sizeof(qs_thread_stkSto), /* stack size in bytes */
TX_MAX_PRIORITIES - 1, /* ThreadX prio (lowest possible) */
TX_MAX_PRIORITIES - 1, /* preemption threshold disabled */
/* start a ThreadX "idle" thread. See NOTE1... */
Q_ALLEGE(tx_thread_create(&idle_thread, /* thread control block */
(CHAR *)("idle"), /* thread name */
&idle_thread_fun, /* thread function */
0LU, /* thread input (unsued) */
idle_thread_stack, /* stack start */
sizeof(idle_thread_stack), /* stack size in bytes */
TX_MAX_PRIORITIES - 1U, /* ThreadX priority (LOWEST possible), NOTE1 */
TX_MAX_PRIORITIES - 1U, /* preemption threshold disabled */
TX_NO_TIME_SLICE,
TX_AUTO_START)
== TX_SUCCESS);
@ -246,12 +255,9 @@ Q_NORETURN Q_onAssert(char_t const * const module, int_t const loc) {
/* QS callbacks ============================================================*/
#ifdef Q_SPY
//............................................................................
static void qs_thread_function(ULONG thread_input) { /* see NOTE1 */
(void)thread_input; /* unused */
/*..........................................................................*/
static void idle_thread_fun(ULONG thread_input) { /* see NOTE1 */
for (;;) {
QS_rxParse(); /* parse all the received bytes */
if ((UART0->FR & UART_FR_TXFE) != 0U) { /* TX done? */
@ -260,15 +266,15 @@ static void qs_thread_function(ULONG thread_input) { /* see NOTE1 */
QF_CRIT_STAT_TYPE intStat;
QF_CRIT_ENTRY(intStat);
block = QS_getBlock(&fifo); /* try to get next block to transmit */
block = QS_getBlock(&fifo); /* try to get next block to transmit */
QF_CRIT_EXIT(intStat);
while (fifo-- != 0) { /* any bytes in the block? */
while (fifo-- != 0U) { /* any bytes in the block? */
UART0->DR = *block++; /* put into the FIFO */
}
}
/* no blocking in this thread; see NOTE1 */
/* no blocking in this "idle" thread; see NOTE1 */
}
}
@ -361,24 +367,17 @@ void QS_onReset(void) {
void QS_onCommand(uint8_t cmdId,
uint32_t param1, uint32_t param2, uint32_t param3)
{
void assert_failed(char const *module, int loc);
(void)cmdId;
(void)param1;
(void)param2;
(void)param3;
QS_BEGIN_ID(COMMAND_STAT, 0U) /* app-specific record */
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_U32(8, param2);
QS_U32(8, param3);
QS_END()
if (cmdId == 10U) {
Q_ERROR();
}
else if (cmdId == 11U) {
assert_failed("QS_onCommand", 123);
}
}
#endif /* Q_SPY */
@ -386,12 +385,12 @@ void QS_onCommand(uint8_t cmdId,
/*****************************************************************************
* NOTE1:
* This application uses the ThreadX thread of the lowest priority to perform
* ThreadX apparently does not have a concpet of an "idle" thread, but
* it can be emulated by a regular, but NON-BLOCKING ThreadX thread of
* the lowest priority.
*
* In the Q_SPY configuration, this "idle" thread is uded to perform
* the QS data output to the host. This is not the only choice available, and
* other applications might choose to peform the QS output some other way.
*
* The lowest-priority thread does not block, so in effect, it becomes the
* idle loop. This presents no problems to ThreadX - its idle task in the
* scheduler does not need to run.
*/

View File

@ -11,9 +11,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Debug\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>dbg</state>
@ -66,15 +70,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -96,27 +92,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -133,7 +115,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -156,7 +138,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -209,13 +191,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -343,10 +333,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -382,16 +368,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -483,7 +459,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -639,6 +615,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -678,13 +658,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -697,17 +673,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -1033,6 +1005,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1056,11 +1048,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -1077,9 +1064,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>BrowseInfoPath</name>
<state>Release\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>rel</state>
@ -1134,14 +1125,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -1162,27 +1145,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -1199,7 +1168,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1222,7 +1191,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1275,13 +1244,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1409,10 +1386,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -1448,16 +1421,6 @@
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -1549,7 +1512,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1705,6 +1668,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -1744,13 +1711,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -1763,17 +1726,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -2099,6 +2058,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2122,11 +2101,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -2143,9 +2117,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Spy\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>spy</state>
@ -2200,14 +2178,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>TM4C123GH6PM TexasInstruments TM4C123GH6PM</state>
@ -2228,27 +2198,13 @@
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -2265,7 +2221,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2288,7 +2244,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2341,13 +2297,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2475,10 +2439,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -2514,16 +2474,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -2615,7 +2565,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2771,6 +2721,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -2810,13 +2764,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -2829,17 +2779,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -3165,6 +3111,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3188,11 +3154,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -3259,6 +3220,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_dyn.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_mem.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf_pkg.h</name>
</file>

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* Last updated for version 6.9.3
* Last updated on 2021-04-08
* Last updated for version 6.9.4
* Last updated on 2021-12-05
*
* Q u a n t u m L e a P s
* ------------------------
@ -54,7 +54,6 @@ static ULONG l_tableStk[256]; /* stack for the Table */
int main() {
Philo_ctor(); /* instantiate all Philosopher active objects */
Table_ctor(); /* instantiate the Table active object */
BSP_init(); /* initialize the Board Support Package */
tx_kernel_enter();
return 0; /* tx_kernel_enter() does not return */
}
@ -62,8 +61,9 @@ int main() {
void tx_application_define(void *first_unused_memory) {
uint8_t n;
(void)first_unused_memory; /* avoid compiler warning about unused arg. */
(void)first_unused_memory; /* unused parameter */
BSP_init(); /* initialize the Board Support Package */
QF_init(); /* initialize the framework and the underlying RT kernel */
QF_psInit(l_subscrSto, Q_DIM(l_subscrSto)); /* init publish-subscribe */
@ -72,12 +72,12 @@ void tx_application_define(void *first_unused_memory) {
QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
QS_OBJ_DICTIONARY(l_smlPoolSto);
QS_OBJ_DICTIONARY(l_tableQueueSto);
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
QS_OBJ_DICTIONARY(AO_Philo[2]);
QS_OBJ_DICTIONARY(AO_Philo[3]);
QS_OBJ_DICTIONARY(AO_Philo[4]);
for (n = 0; n < N_PHILO; ++n) { /* start the active objects... */
QActive_setAttr(AO_Philo[n], THREAD_NAME_ATTR, "Philo");

View File

@ -1,13 +1,13 @@
/*****************************************************************************
* Product: "Dining Philosophers Problem" example, ThreadX kernel
* Last updated for version 6.9.1
* Last updated on 2020-09-22
* Product: "DPP example, STM32F429 Discovery board, ThreadX kernel
* Last updated for version 6.9.4
* Last updated on 2021-12-03
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@ -65,17 +65,26 @@ static TX_TIMER l_tick_timer; /* ThreadX timer to call QF_TICK_X() */
QSTimeCtr QS_tickPeriod_;
enum AppRecords { /* application-specific trace records */
PHILO_STAT = QS_USER
PHILO_STAT = QS_USER,
COMMAND_STAT
};
/* ThreadX thread and thread function for QS output, see NOTE1 */
static TX_THREAD l_qs_output_thread;
static void qs_thread_function(ULONG thread_input);
static ULONG qs_thread_stkSto[64];
/* QSpy source IDs */
static QSpyId const l_clock_tick = { QS_AP_ID };
#endif
/* ISRs used in the application ==========================================*/
#ifdef Q_SPY
/*
* ISR for receiving bytes from the QSPY Back-End
* NOTE: This ISR is "QF-unaware" meaning that it does not interact with
* the QF/QK and is not disabled. Such ISRs don't need to call QK_ISR_ENTRY/
* QK_ISR_EXIT and they cannot post or publish events.
*/
//TBD...
#endif
/* BSP functions ===========================================================*/
void BSP_init(void) {
GPIO_InitTypeDef GPIO_struct;
@ -133,6 +142,7 @@ void BSP_init(void) {
Q_ERROR();
}
QS_USR_DICTIONARY(PHILO_STAT);
QS_USR_DICTIONARY(COMMAND_STAT);
/* setup the QS filters... */
QS_GLB_FILTER(QS_ALL_RECORDS);
@ -192,7 +202,18 @@ void BSP_terminate(int16_t result) {
}
#ifdef Q_SPY
/* ThreadX "idle" thread for QS output, see NOTE1 */
static TX_THREAD idle_thread;
static void idle_thread_fun(ULONG thread_input);
static ULONG idle_thread_stack[64];
#endif
/* QF callbacks ============================================================*/
static VOID timer_expiration(ULONG id) {
QF_TICK_X(id, &l_clock_tick); /* perform the QF clock tick processing */
}
/*..........................................................................*/
void QF_onStartup(void) {
/*
* NOTE:
@ -206,8 +227,8 @@ void QF_onStartup(void) {
* or from active object(s).
*/
Q_ALLEGE(tx_timer_create(&l_tick_timer, /* ThreadX timer object */
(CHAR *)"QF_TICK", /* name of the timer */
(VOID (*)(ULONG))&QF_tickX_, /* expiration function */
(CHAR *)"QP-tick", /* name of the timer */
&timer_expiration, /* expiration function */
0U, /* expiration function input (tick rate) */
1U, /* initial ticks */
1U, /* reschedule ticks */
@ -215,15 +236,17 @@ void QF_onStartup(void) {
== TX_SUCCESS);
#ifdef Q_SPY
/* start a ThreadX timer to perform QS output. See NOTE1... */
Q_ALLEGE(tx_thread_create(&l_qs_output_thread, /* thread control block */
(CHAR *)"QS_TX", /* thread name */
&qs_thread_function, /* thread function */
0UL, /* thread input (unsued) */
qs_thread_stkSto, /* stack start */
sizeof(qs_thread_stkSto), /* stack size in bytes */
TX_MAX_PRIORITIES - 1, /* ThreadX prio (lowest possible) */
TX_MAX_PRIORITIES - 1, /* preemption threshold disabled */
//TBD: enable the UART ISR for receiving bytes...
/* start a ThreadX "idle" thread. See NOTE1... */
Q_ALLEGE(tx_thread_create(&idle_thread, /* thread control block */
(CHAR *)("idle"), /* thread name */
&idle_thread_fun, /* thread function */
0LU, /* thread input (unsued) */
idle_thread_stack, /* stack start */
sizeof(idle_thread_stack), /* stack size in bytes */
TX_MAX_PRIORITIES - 1U, /* ThreadX priority (LOWEST possible), NOTE1 */
TX_MAX_PRIORITIES - 1U, /* preemption threshold disabled */
TX_NO_TIME_SLICE,
TX_AUTO_START)
== TX_SUCCESS);
@ -247,11 +270,10 @@ Q_NORETURN Q_onAssert(char_t const * const module, int_t const loc) {
/* QS callbacks ============================================================*/
#ifdef Q_SPY
//............................................................................
static void qs_thread_function(ULONG thread_input) { /* see NOTE1 */
(void)thread_input; /* unused */
/*..........................................................................*/
static void idle_thread_fun(ULONG thread_input) { /* see NOTE1 */
for (;;) {
QS_rxParse(); /* parse all the received bytes */
/* turn the LED6 on an off to visualize the QS activity */
LED_GPIO_PORT->BSRRL = LED6_PIN; /* turn LED on */
@ -260,21 +282,21 @@ static void qs_thread_function(ULONG thread_input) { /* see NOTE1 */
__NOP();
__NOP();
LED_GPIO_PORT->BSRRH = LED6_PIN; /* turn LED off */
if ((USART2->SR & 0x80U) != 0U) { /* is TXE empty? */
uint16_t b;
QF_CRIT_STAT_TYPE intStat;
QF_CRIT_ENTRY(intStat);
b = QS_getByte();
QF_CRIT_EXIT(intStat);
if (b != QS_EOD) { /* not End-Of-Data? */
USART2->DR = (b & 0xFFU); /* put into the DR register */
}
}
/* no blocking in this thread; see NOTE1 */
/* no blocking in this "idle" thread; see NOTE1 */
}
}
@ -315,6 +337,9 @@ uint8_t QS_onStartup(void const *arg) {
USART_Cmd(USART2, ENABLE); // enable USART2
/* configure UART interrupts (for the RX channel) */
//TBD...
QS_tickPeriod_ = SystemCoreClock / BSP_TICKS_PER_SEC;
QS_tickTime_ = QS_tickPeriod_; /* to start the timestamp at zero */
@ -347,18 +372,40 @@ void QS_onFlush(void) {
}
QF_CRIT_EXIT(intStat);
}
/*..........................................................................*/
/*! callback function to reset the target (to be implemented in the BSP) */
void QS_onReset(void) {
NVIC_SystemReset();
}
/*..........................................................................*/
/*! callback function to execute a user command (to be implemented in BSP) */
void QS_onCommand(uint8_t cmdId,
uint32_t param1, uint32_t param2, uint32_t param3)
{
(void)cmdId;
(void)param1;
(void)param2;
(void)param3;
QS_BEGIN_ID(COMMAND_STAT, 0U) /* app-specific record */
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_U32(8, param2);
QS_U32(8, param3);
QS_END()
}
#endif /* Q_SPY */
/*--------------------------------------------------------------------------*/
/*****************************************************************************
* NOTE1:
* This application uses the ThreadX thread of the lowest priority to perform
* ThreadX apparently does not have a concpet of an "idle" thread, but
* it can be emulated by a regular, but NON-BLOCKING ThreadX thread of
* the lowest priority.
*
* In the Q_SPY configuration, this "idle" thread is uded to perform
* the QS data output to the host. This is not the only choice available, and
* other applications might choose to peform the QS output some other way.
*
* The lowest-priority thread does not block, so in effect, it becomes the
* idle loop. This presents no problems to ThreadX - its idle task in the
* scheduler does not need to run.
*/

View File

@ -11,9 +11,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Debug\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>dbg</state>
@ -66,15 +70,7 @@
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
<state>9.10.2.39304</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
@ -96,27 +92,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -133,7 +115,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -156,7 +138,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -209,13 +191,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -343,10 +333,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -383,16 +369,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -484,7 +460,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -640,6 +616,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -679,13 +659,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -698,17 +674,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -1034,6 +1006,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -1057,11 +1049,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -1078,9 +1065,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>BrowseInfoPath</name>
<state>Release\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>rel</state>
@ -1135,14 +1126,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>STM32F407VG ST STM32F407VG</state>
@ -1163,27 +1146,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1200,7 +1169,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1223,7 +1192,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -1276,13 +1245,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1410,10 +1387,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -1450,16 +1423,6 @@
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -1551,7 +1514,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -1707,6 +1670,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -1746,13 +1713,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -1765,17 +1728,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -2101,6 +2060,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -2124,11 +2103,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -2145,9 +2119,13 @@
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>31</version>
<version>33</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>BrowseInfoPath</name>
<state>Spy\BrowseInfo</state>
</option>
<option>
<name>ExePath</name>
<state>spy</state>
@ -2202,14 +2180,6 @@
<name>OGLastSavedByProductVersion</name>
<state>8.50.6.28950</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>STM32F407VG ST STM32F407VG</state>
@ -2230,27 +2200,13 @@
<name>GenStdoutInterface</name>
<state>1</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>28</version>
<version>30</version>
<state>40</state>
</option>
<option>
@ -2267,7 +2223,7 @@
</option>
<option>
<name>CoreVariant</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2290,7 +2246,7 @@
</option>
<option>
<name>GFPUCoreSlave2</name>
<version>28</version>
<version>30</version>
<state>39</state>
</option>
<option>
@ -2343,13 +2299,21 @@
<version>0</version>
<state>0</state>
</option>
<option>
<name>OGAarch64Abi</name>
<state>0</state>
</option>
<option>
<name>OG_32_64Device</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>36</version>
<version>37</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2477,10 +2441,6 @@
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
@ -2517,16 +2477,6 @@
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
@ -2618,7 +2568,7 @@
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<version>11</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -2774,6 +2724,10 @@
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
</data>
</settings>
<settings>
@ -2813,13 +2767,9 @@
<extensions></extensions>
<cmdline></cmdline>
<hasPrio>0</hasPrio>
<buildSequence>inputOutputBased</buildSequence>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
@ -2832,17 +2782,13 @@
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>23</version>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
@ -3168,6 +3114,26 @@
<name>IlinkRawBinaryAlign2</name>
<state></state>
</option>
<option>
<name>IlinkLogCrtRoutineSelection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFragmentInfo</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInlining</name>
<state>0</state>
</option>
<option>
<name>IlinkLogMerging</name>
<state>0</state>
</option>
<option>
<name>IlinkDemangle</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -3191,11 +3157,6 @@
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data />
</settings>
<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
@ -3247,6 +3208,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_dyn.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf\qf_mem.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\src\qf_pkg.h</name>
</file>

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* Last updated for version 6.9.3
* Last updated on 2021-04-08
* Last updated for version 6.9.4
* Last updated on 2021-12-05
*
* Q u a n t u m L e a P s
* ------------------------
@ -54,7 +54,6 @@ static ULONG l_tableStk[256]; /* stack for the Table */
int main() {
Philo_ctor(); /* instantiate all Philosopher active objects */
Table_ctor(); /* instantiate the Table active object */
BSP_init(); /* initialize the Board Support Package */
tx_kernel_enter();
return 0; /* tx_kernel_enter() does not return */
}
@ -62,8 +61,9 @@ int main() {
void tx_application_define(void *first_unused_memory) {
uint8_t n;
(void)first_unused_memory; /* avoid compiler warning about unused arg. */
(void)first_unused_memory; /* unused parameter */
BSP_init(); /* initialize the Board Support Package */
QF_init(); /* initialize the framework and the underlying RT kernel */
QF_psInit(l_subscrSto, Q_DIM(l_subscrSto)); /* init publish-subscribe */
@ -72,12 +72,12 @@ void tx_application_define(void *first_unused_memory) {
QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
QS_OBJ_DICTIONARY(l_smlPoolSto);
QS_OBJ_DICTIONARY(l_tableQueueSto);
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
QS_OBJ_DICTIONARY(AO_Philo[2]);
QS_OBJ_DICTIONARY(AO_Philo[3]);
QS_OBJ_DICTIONARY(AO_Philo[4]);
for (n = 0; n < N_PHILO; ++n) { /* start the active objects... */
QActive_setAttr(AO_Philo[n], THREAD_NAME_ATTR, "Philo");

View File

@ -0,0 +1,12 @@
This directory contains examples for QP-ThreadX port running
on top of Windows (with the Win32 API). The examples use the
following ports:
1. Unmodified QP-port to ThreadX (qpc\ports\threadx)
2. Unmodified ThreadX port to Win32 (qpc\3rd_party\threadx\ports\win32)
The example demonstrates QP/Spy software tracing (the QSpy build
configuration). The QP/Spy tracing uses TCP/IP for the data transport.
Quantum Leaps,
2021-12-05

View File

@ -0,0 +1,467 @@
/*****************************************************************************
* Product: DPP example, ThreadX kernel, Win32 emulation, console app.
* Last updated for version 6.9.4
* Last updated on 2021-12-03
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <www.gnu.org/licenses/>.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*****************************************************************************/
/* Win32 configuration macros needed for proper WinSock includes */
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0501
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
#include <stdio.h> /* for printf_s() */
#include <stdlib.h> /* for exit() */
#include <conio.h> /* for keyboard input */
Q_DEFINE_THIS_FILE
/* Local-scope objects -----------------------------------------------------*/
static uint32_t l_rnd; /* random seed */
static TX_TIMER l_tick_timer; /* ThreadX timer to call QF_TICK_X() */
#ifdef Q_SPY
enum AppRecords { /* application-specific trace records */
PHILO_STAT = QS_USER,
COMMAND_STAT
};
/* QSpy source IDs */
static QSpyId const l_clock_tick = { QS_AP_ID };
static void QS_rx_input(void);
static void QS_output(void);
#endif
/*..........................................................................*/
void BSP_init(void) {
printf_s("Dining Philosophers Problem example\n"
"QP port to ThreadX\n"
"ThreadX port to Win32\n"
"QP %s\n"
"Press 'p' to pause\n"
"Press 's' to serve\n"
"Press 'x' to quit...\n",
QP_versionStr);
/* seed the random number generator */
BSP_randomSeed(1234U);
if (QS_INIT((void *)0) == 0U) { /* initialize the QS software tracing */
Q_ERROR();
}
QS_USR_DICTIONARY(PHILO_STAT);
QS_USR_DICTIONARY(COMMAND_STAT);
/* setup the QS filters... */
QS_GLB_FILTER(QS_ALL_RECORDS);
QS_GLB_FILTER(-QS_QF_TICK);
}
/*..........................................................................*/
void BSP_displayPhilStat(uint8_t n, char const *stat) {
printf("Philo[%d] is %s\n", (int)n, stat);
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->prio) /* app-specific record */
QS_U8(1, n); /* Philosopher number */
QS_STR(stat); /* Philosopher status */
QS_END()
}
/*..........................................................................*/
void BSP_displayPaused(uint8_t paused) {
printf("%s\n", paused ? "PAUSED" : "SERVING");
}
/*..........................................................................*/
uint32_t BSP_random(void) { /* a very cheap pseudo-random-number generator */
uint32_t rnd;
/* Some flating point code is to exercise the VFP... */
float volatile x = 3.1415926F;
x = x + 2.7182818F;
/* "Super-Duper" Linear Congruential Generator (LCG)
* LCG(2^32, 3*7*11*13*23, 0, seed)
*/
rnd = l_rnd * (3U*7U*11U*13U*23U);
l_rnd = rnd; /* set for the next time */
return (rnd >> 8);
}
/*..........................................................................*/
void BSP_randomSeed(uint32_t seed) {
l_rnd = seed;
}
/*..........................................................................*/
void BSP_terminate(int16_t result) {
(void)result;
}
/* QF callbacks ============================================================*/
static VOID timer_expiration(ULONG id) {
(void)id; /* unused parameter */
QF_TICK_X(0U, &l_clock_tick); /* perform the QF clock tick processing */
/* handle keyborad input... */
if (_kbhit()) {
int ch = _getwch();
switch (ch) {
case 'p': {
QF_PUBLISH(Q_NEW(QEvt, PAUSE_SIG), &l_clock_tick);
break;
}
case 's': {
QF_PUBLISH(Q_NEW(QEvt, SERVE_SIG), &l_clock_tick);
break;
}
case 'x': {
QF_stop();
break;
}
default: {
break;
}
}
}
/* also in case of Win32, perform here QS RX/TX... */
QS_RX_INPUT(); /* handle the QS-RX input */
QS_OUTPUT(); /* handle the QS-TX output */
}
/*..........................................................................*/
void QF_onStartup(void) {
/*
* NOTE:
* This application uses the ThreadX timer to periodically call
* the QF_tickX_(0) function. Here, only the clock tick rate of 0
* is used, but other timers can be used to call QF_tickX_() for
* other clock tick rates, if needed.
*
* The choice of a ThreadX timer is not the only option. Applications
* might choose to call QF_TICK_X() directly from timer interrupts
* or from active object(s).
*/
Q_ALLEGE(tx_timer_create(&l_tick_timer, /* ThreadX timer object */
(CHAR *)"QP-tick", /* name of the timer */
&timer_expiration, /* expiration function */
0U, /* expiration function input (tick rate) */
1U, /* initial ticks */
1U, /* reschedule ticks */
TX_AUTO_ACTIVATE) /* automatically activate timer */
== TX_SUCCESS);
}
/*..........................................................................*/
void QF_onCleanup(void) {
#ifdef Q_SPY
QS_onCleanup();
#endif
exit(0);
}
/*..........................................................................*/
Q_NORETURN Q_onAssert(char_t const * const module, int_t const loc) {
printf("Assertion failed in %s:%d\n", module, loc);
QS_ASSERTION(module, loc, 10000U); /* report assertion to QS */
}
/* QS callbacks ============================================================*/
#ifdef Q_SPY
#include "qs_pkg.h" /* QS package-scope interface for QS_rxPriv_ */
#include <ws2tcpip.h> /* for TCP/IP transport used by QS */
#define QS_TX_SIZE (8*1024)
#define QS_RX_SIZE (2*1024)
#define QS_TX_CHUNK QS_TX_SIZE
#define QS_TIMEOUT_MS 10
/* local variables .........................................................*/
static SOCKET l_sock = INVALID_SOCKET;
/*..........................................................................*/
uint8_t QS_onStartup(void const* arg) {
static uint8_t qsBuf[QS_TX_SIZE]; /* buffer for QS-TX channel */
static uint8_t qsRxBuf[QS_RX_SIZE]; /* buffer for QS-RX channel */
char hostName[128];
char const* serviceName = "6601"; /* default QSPY server port */
char const* src;
char* dst;
int status;
struct addrinfo* result = NULL;
struct addrinfo* rp = NULL;
struct addrinfo hints;
BOOL sockopt_bool;
ULONG ioctl_opt;
WSADATA wsaData;
/* initialize the QS transmit and receive buffers */
QS_initBuf(qsBuf, sizeof(qsBuf));
QS_rxInitBuf(qsRxBuf, sizeof(qsRxBuf));
/* initialize Windows sockets version 2.2 */
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != NO_ERROR) {
fprintf_s(stderr, "<TARGET> ERROR %s\n",
"Windows Sockets cannot be initialized");
goto error;
}
/* extract hostName from 'arg' (hostName:port_remote)... */
src = (arg != (void*)0)
? (char const*)arg
: "localhost"; /* default QSPY host */
dst = hostName;
while ((*src != '\0')
&& (*src != ':')
&& (dst < &hostName[sizeof(hostName) - 1]))
{
*dst++ = *src++;
}
*dst = '\0'; /* zero-terminate hostName */
/* extract serviceName from 'arg' (hostName:serviceName)... */
if (*src == ':') {
serviceName = src + 1;
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
status = getaddrinfo(hostName, serviceName, &hints, &result);
if (status != 0) {
fprintf_s(stderr,
"<TARGET> ERROR cannot resolve host Name=%s:%s,Err=%d\n",
hostName, serviceName, status);
goto error;
}
for (rp = result; rp != NULL; rp = rp->ai_next) {
l_sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
if (l_sock != INVALID_SOCKET) {
if (connect(l_sock, rp->ai_addr, (int)rp->ai_addrlen)
== SOCKET_ERROR)
{
closesocket(l_sock);
l_sock = INVALID_SOCKET;
}
break;
}
}
freeaddrinfo(result);
/* socket could not be opened & connected? */
if (l_sock == INVALID_SOCKET) {
fprintf_s(stderr, "<TARGET> ERROR cannot connect to QSPY at "
"host=%s:%s\n",
hostName, serviceName);
goto error;
}
/* set the socket to non-blocking mode */
ioctl_opt = 1;
if (ioctlsocket(l_sock, FIONBIO, &ioctl_opt) != NO_ERROR) {
fprintf_s(stderr, "<TARGET> ERROR %s WASErr=%d\n,",
"Failed to set non-blocking socket", WSAGetLastError());
goto error;
}
/* configure the socket to reuse the address and not to linger */
sockopt_bool = TRUE;
setsockopt(l_sock, SOL_SOCKET, SO_REUSEADDR,
(const char*)&sockopt_bool, sizeof(sockopt_bool));
sockopt_bool = TRUE;
setsockopt(l_sock, SOL_SOCKET, SO_DONTLINGER,
(const char*)&sockopt_bool, sizeof(sockopt_bool));
QS_onFlush();
return 1U; /* success */
error:
return 0U; /* failure */
}
/*..........................................................................*/
void QS_onCleanup(void) {
if (l_sock != INVALID_SOCKET) {
closesocket(l_sock);
l_sock = INVALID_SOCKET;
}
WSACleanup();
printf_s("<TARGET> Disconnected from QSPY\n");
}
/*..........................................................................*/
void QS_onReset(void) {
QS_onCleanup();
exit(0);
}
/*..........................................................................*/
void QS_onFlush(void) {
uint16_t nBytes;
uint8_t const* data;
QS_CRIT_STAT_
if (l_sock == INVALID_SOCKET) { /* socket NOT initialized? */
fprintf_s(stderr, "<TARGET> ERROR %s\n",
"invalid TCP socket");
return;
}
nBytes = QS_TX_CHUNK;
QS_CRIT_E_();
while ((data = QS_getBlock(&nBytes)) != (uint8_t*)0) {
QS_CRIT_X_();
for (;;) { /* for-ever until break or return */
int nSent = send(l_sock, (char const*)data, (int)nBytes, 0);
if (nSent == SOCKET_ERROR) { /* sending failed? */
int err = WSAGetLastError();
if (err == WSAEWOULDBLOCK) {
/* sleep for the timeout and then loop back
* to send() the SAME data again
*/
Sleep(QS_TIMEOUT_MS);
}
else { /* some other socket error... */
fprintf_s(stderr, "<TARGET> ERROR %s WASErr=%d\n",
"sending data over TCP", err);
return;
}
}
else if (nSent < (int)nBytes) { /* sent fewer than requested? */
Sleep(QS_TIMEOUT_MS); /* sleep for the timeout */
/* adjust the data and loop back to send() the rest */
data += nSent;
nBytes -= (uint16_t)nSent;
}
else {
break; /* break out of the for-ever loop */
}
}
/* set nBytes for the next call to QS_getBlock() */
nBytes = QS_TX_CHUNK;
QS_CRIT_E_();
}
QS_CRIT_X_();
}
/*..........................................................................*/
QSTimeCtr QS_onGetTime(void) {
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
return (QSTimeCtr)time.QuadPart;
}
/*..........................................................................*/
/*! callback function to execute a user command (to be implemented in BSP) */
void QS_onCommand(uint8_t cmdId,
uint32_t param1, uint32_t param2, uint32_t param3)
{
(void)cmdId;
(void)param1;
(void)param2;
(void)param3;
QS_BEGIN_ID(COMMAND_STAT, 0U) /* app-specific record */
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_U32(8, param2);
QS_U32(8, param3);
QS_END()
}
/*..........................................................................*/
static void QS_output(void) {
uint16_t nBytes;
uint8_t const* data;
QS_CRIT_STAT_
if (l_sock == INVALID_SOCKET) { /* socket NOT initialized? */
fprintf_s(stderr, "<TARGET> ERROR %s\n",
"invalid TCP socket");
return;
}
nBytes = QS_TX_CHUNK;
QS_CRIT_E_();
if ((data = QS_getBlock(&nBytes)) != (uint8_t*)0) {
QS_CRIT_X_();
for (;;) { /* for-ever until break or return */
int nSent = send(l_sock, (char const*)data, (int)nBytes, 0);
if (nSent == SOCKET_ERROR) { /* sending failed? */
int err = WSAGetLastError();
if (err == WSAEWOULDBLOCK) {
/* sleep for the timeout and then loop back
* to send() the SAME data again
*/
Sleep(QS_TIMEOUT_MS);
}
else { /* some other socket error... */
fprintf_s(stderr, "<TARGET> ERROR sending data over TCP,"
"WASErr=%d\n", err);
return;
}
}
else if (nSent < (int)nBytes) { /* sent fewer than requested? */
Sleep(QS_TIMEOUT_MS); /* sleep for the timeout */
/* adjust the data and loop back to send() the rest */
data += nSent;
nBytes -= (uint16_t)nSent;
}
else {
break;
}
}
}
else {
QS_CRIT_X_();
}
}
/*..........................................................................*/
static void QS_rx_input(void) {
int status = recv(l_sock, (char*)QS_rxPriv_.buf, (int)QS_rxPriv_.end, 0);
if (status > 0) { /* any data received? */
QS_rxPriv_.tail = 0U;
QS_rxPriv_.head = status; /* # bytes received */
QS_rxParse(); /* parse all received bytes */
}
}
#endif /* Q_SPY */
/*--------------------------------------------------------------------------*/
/*****************************************************************************
* NOTE1:
* This application uses the ThreadX thread of the lowest priority to perform
* the QS data output to the host. This is not the only choice available, and
* other applications might choose to peform the QS output some other way.
*
* The lowest-priority thread does not block, so in effect, it becomes the
* idle loop. This presents no problems to ThreadX - its idle task in the
* scheduler does not need to run.
*/

View File

@ -0,0 +1,47 @@
/*****************************************************************************
* Product: DPP example, ThreadX
* Last Updated for Version: 6.3.8
* Date of the Last Update: 2019-01-30
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <www.gnu.org/licenses/>.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*****************************************************************************/
#ifndef BSP_H
#define BSP_H
#define BSP_TICKS_PER_SEC TX_TIMER_TICKS_PER_SECOND
void BSP_init(void);
void BSP_displayPaused(uint8_t paused);
void BSP_displayPhilStat(uint8_t n, char_t const *stat);
void BSP_terminate(int16_t result);
void BSP_randomSeed(uint32_t seed); /* random seed */
uint32_t BSP_random(void); /* pseudo-random generator */
#endif /* BSP_H */

View File

@ -0,0 +1,76 @@
/*.$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::dpp.h}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/*.$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifndef DPP_H
#define DPP_H
enum DPPSignals {
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
DONE_SIG, /* published by Philosopher when done eating */
PAUSE_SIG, /* published by BSP to pause serving forks */
SERVE_SIG, /* published by BSP to serve re-start serving forks */
TEST_SIG, /* published by BSP to test the application */
MAX_PUB_SIG, /* the last published signal */
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
TIMEOUT_SIG, /* used by Philosophers for time events */
MAX_SIG /* the last signal */
};
/*.$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${Events::TableEvt} .....................................................*/
typedef struct {
/* protected: */
QEvt super;
/* public: */
uint8_t philoNum;
} TableEvt;
/*.$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
/*.$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
void Philo_ctor(void);
/*.$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* opaque pointers to the Philo AOs */
extern QActive * const AO_Philo[N_PHILO];
/*.$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
void Table_ctor(void);
/*.$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* opaque pointer to the Table AO */
extern QActive * const AO_Table;
/*.$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifdef QXK_H
void Test1_ctor(void);
extern QXThread * const XT_Test1;
void Test2_ctor(void);
extern QXThread * const XT_Test2;
#endif /* QXK_H */
#endif /* DPP_H */

View File

@ -0,0 +1,471 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.3" links="1">
<documentation>Dining Philosopher Problem example
NOTE: Requries QP5.</documentation>
<!--${qpc}-->
<framework name="qpc"/>
<!--${Events}-->
<package name="Events" stereotype="0x01">
<!--${Events::TableEvt}-->
<class name="TableEvt" superclass="qpc::QEvt">
<!--${Events::TableEvt::philoNum}-->
<attribute name="philoNum" type="uint8_t" visibility="0x00" properties="0x00"/>
</class>
</package>
<!--${AOs}-->
<package name="AOs" stereotype="0x02">
<!--${AOs::Philo}-->
<class name="Philo" superclass="qpc::QActive">
<!--${AOs::Philo::timeEvt}-->
<attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
<!--${AOs::Philo::SM}-->
<statechart properties="0x01">
<!--${AOs::Philo::SM::initial}-->
<initial target="../1">
<action>static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
(void)par; /* unused parameter */
if (registered == (uint8_t)0) {
registered = (uint8_t)1;
QS_OBJ_DICTIONARY(&amp;l_philo[0].timeEvt);
QS_OBJ_DICTIONARY(&amp;l_philo[1].timeEvt);
QS_OBJ_DICTIONARY(&amp;l_philo[2].timeEvt);
QS_OBJ_DICTIONARY(&amp;l_philo[3].timeEvt);
QS_OBJ_DICTIONARY(&amp;l_philo[4].timeEvt);
QS_FUN_DICTIONARY(&amp;Philo_initial);
QS_FUN_DICTIONARY(&amp;Philo_thinking);
QS_FUN_DICTIONARY(&amp;Philo_hungry);
QS_FUN_DICTIONARY(&amp;Philo_eating);
}
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
QActive_subscribe(&amp;me-&gt;super, EAT_SIG);
QActive_subscribe(&amp;me-&gt;super, TEST_SIG);</action>
<initial_glyph conn="2,3,5,1,20,5,-3">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${AOs::Philo::SM::thinking}-->
<state name="thinking">
<entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
<exit>QTimeEvt_disarm(&amp;me-&gt;timeEvt);</exit>
<!--${AOs::Philo::SM::thinking::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../2">
<tran_glyph conn="2,13,3,1,20,12,-3">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${AOs::Philo::SM::thinking::EAT, DONE}-->
<tran trig="EAT, DONE">
<action>/* EAT or DONE must be for other Philos than this one */
Q_ASSERT_ID(10, Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
<tran_glyph conn="2,17,3,-1,13">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,5,17,16">
<entry box="1,2,5,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<!--${AOs::Philo::SM::hungry}-->
<state name="hungry">
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe-&gt;philoNum = PHILO_ID(me);
QACTIVE_POST(AO_Table, &amp;pe-&gt;super, me);</entry>
<!--${AOs::Philo::SM::hungry::EAT}-->
<tran trig="EAT">
<!--${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~}-->
<choice target="../../../3">
<guard>Q_EVT_CAST(TableEvt)-&gt;philoNum == PHILO_ID(me)</guard>
<choice_glyph conn="15,30,5,1,7,13,-3">
<action box="1,0,19,4"/>
</choice_glyph>
</choice>
<tran_glyph conn="2,30,3,-1,13">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<!--${AOs::Philo::SM::hungry::DONE}-->
<tran trig="DONE">
<action>/* DONE must be for other Philos than this one */
Q_ASSERT_ID(20, Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
<tran_glyph conn="2,36,3,-1,14">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,23,17,16">
<entry box="1,2,5,2"/>
</state_glyph>
</state>
<!--${AOs::Philo::SM::eating}-->
<state name="eating">
<entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe-&gt;philoNum = PHILO_ID(me);
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QTimeEvt_disarm(&amp;me-&gt;timeEvt);</exit>
<!--${AOs::Philo::SM::eating::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../1">
<tran_glyph conn="2,51,3,1,22,-41,-5">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${AOs::Philo::SM::eating::EAT, DONE}-->
<tran trig="EAT, DONE">
<action>/* EAT or DONE must be for other Philos than this one */
Q_ASSERT_ID(30, Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
<tran_glyph conn="2,55,3,-1,13">
<action box="0,-2,14,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,41,17,18">
<entry box="1,2,5,2"/>
<exit box="1,4,5,2"/>
</state_glyph>
</state>
<state_diagram size="37,61"/>
</statechart>
</class>
<!--${AOs::Table}-->
<class name="Table" superclass="qpc::QActive">
<!--${AOs::Table::fork[N_PHILO]}-->
<attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
<!--${AOs::Table::isHungry[N_PHILO]}-->
<attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
<!--${AOs::Table::SM}-->
<statechart properties="0x03">
<!--${AOs::Table::SM::initial}-->
<initial target="../1/1">
<action>uint8_t n;
(void)par; /* unused parameter */
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
QActive_subscribe(&amp;me-&gt;super, DONE_SIG);
QActive_subscribe(&amp;me-&gt;super, PAUSE_SIG);
QActive_subscribe(&amp;me-&gt;super, SERVE_SIG);
QActive_subscribe(&amp;me-&gt;super, TEST_SIG);
for (n = 0U; n &lt; N_PHILO; ++n) {
me-&gt;fork[n] = FREE;
me-&gt;isHungry[n] = 0U;
BSP_displayPhilStat(n, &quot;thinking&quot;);
}</action>
<initial_glyph conn="3,3,5,1,44,18,-9">
<action box="0,-2,6,2"/>
</initial_glyph>
</initial>
<!--${AOs::Table::SM::active}-->
<state name="active">
<!--${AOs::Table::SM::active::EAT}-->
<tran trig="EAT">
<action>Q_ERROR_ID(60);</action>
<tran_glyph conn="2,15,3,-1,14">
<action box="0,-2,17,4"/>
</tran_glyph>
</tran>
<!--${AOs::Table::SM::active::serving}-->
<state name="serving">
<entry brief="give pending permissions to eat">uint8_t n;
for (n = 0U; n &lt; N_PHILO; ++n) { /* give permissions to eat... */
if ((me-&gt;isHungry[n] != 0U)
&amp;&amp; (me-&gt;fork[LEFT(n)] == FREE)
&amp;&amp; (me-&gt;fork[n] == FREE))
{
TableEvt *te;
me-&gt;fork[LEFT(n)] = USED;
me-&gt;fork[n] = USED;
te = Q_NEW(TableEvt, EAT_SIG);
te-&gt;philoNum = n;
QF_PUBLISH(&amp;te-&gt;super, &amp;me-&gt;super);
me-&gt;isHungry[n] = 0U;
BSP_displayPhilStat(n, &quot;eating &quot;);
}
}</entry>
<!--${AOs::Table::SM::active::serving::HUNGRY}-->
<tran trig="HUNGRY">
<action>uint8_t n, m;
n = Q_EVT_CAST(TableEvt)-&gt;philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(40, (n &lt; N_PHILO) &amp;&amp; (me-&gt;isHungry[n] == 0U));
BSP_displayPhilStat(n, &quot;hungry &quot;);
m = LEFT(n);</action>
<!--${AOs::Table::SM::active::serving::HUNGRY::[bothfree]}-->
<choice>
<guard brief="both free">(me-&gt;fork[m] == FREE) &amp;&amp; (me-&gt;fork[n] == FREE)</guard>
<action>TableEvt *pe;
me-&gt;fork[m] = USED;
me-&gt;fork[n] = USED;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = n;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(n, &quot;eating &quot;);</action>
<choice_glyph conn="19,26,5,-1,10">
<action box="1,0,10,2"/>
</choice_glyph>
</choice>
<!--${AOs::Table::SM::active::serving::HUNGRY::[else]}-->
<choice>
<guard>else</guard>
<action>me-&gt;isHungry[n] = 1U;</action>
<choice_glyph conn="19,26,4,-1,5,10">
<action box="1,5,6,2"/>
</choice_glyph>
</choice>
<tran_glyph conn="4,26,3,-1,15">
<action box="0,-2,8,2"/>
</tran_glyph>
</tran>
<!--${AOs::Table::SM::active::serving::DONE}-->
<tran trig="DONE">
<action>uint8_t n, m;
TableEvt *pe;
n = Q_EVT_CAST(TableEvt)-&gt;philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(50, (n &lt; N_PHILO) &amp;&amp; (me-&gt;isHungry[n] == 0U));
BSP_displayPhilStat(n, &quot;thinking&quot;);
m = LEFT(n);
/* both forks of Phil[n] must be used */
Q_ASSERT_ID(51, (me-&gt;fork[n] == USED) &amp;&amp; (me-&gt;fork[m] == USED));
me-&gt;fork[m] = FREE;
me-&gt;fork[n] = FREE;
m = RIGHT(n); /* check the right neighbor */
if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[m] == FREE)) {
me-&gt;fork[n] = USED;
me-&gt;fork[m] = USED;
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}
m = LEFT(n); /* check the left neighbor */
n = LEFT(m); /* left fork of the left neighbor */
if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[n] == FREE)) {
me-&gt;fork[m] = USED;
me-&gt;fork[n] = USED;
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}</action>
<tran_glyph conn="4,34,3,-1,15">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${AOs::Table::SM::active::serving::PAUSE}-->
<tran trig="PAUSE" target="../../2">
<tran_glyph conn="4,40,3,1,37,7,-3">
<action box="0,-2,7,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,19,34,24">
<entry box="1,2,27,2"/>
</state_glyph>
</state>
<!--${AOs::Table::SM::active::paused}-->
<state name="paused">
<entry>BSP_displayPaused(1U);</entry>
<exit>BSP_displayPaused(0U);</exit>
<!--${AOs::Table::SM::active::paused::SERVE}-->
<tran trig="SERVE" target="../../1">
<tran_glyph conn="4,57,3,1,39,-23,-5">
<action box="0,-2,7,2"/>
</tran_glyph>
</tran>
<!--${AOs::Table::SM::active::paused::HUNGRY}-->
<tran trig="HUNGRY">
<action>uint8_t n = Q_EVT_CAST(TableEvt)-&gt;philoNum;
/* philo ID must be in range and he must be not hungry */
Q_ASSERT_ID(60, (n &lt; N_PHILO) &amp;&amp; (me-&gt;isHungry[n] == 0U));
me-&gt;isHungry[n] = 1U;
BSP_displayPhilStat(n, &quot;hungry &quot;);</action>
<tran_glyph conn="4,60,3,-1,15">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<!--${AOs::Table::SM::active::paused::DONE}-->
<tran trig="DONE">
<action>uint8_t n, m;
n = Q_EVT_CAST(TableEvt)-&gt;philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(70, (n &lt; N_PHILO) &amp;&amp; (me-&gt;isHungry[n] == 0U));
BSP_displayPhilStat(n, &quot;thinking&quot;);
m = LEFT(n);
/* both forks of Phil[n] must be used */
Q_ASSERT_ID(71, (me-&gt;fork[n] == USED) &amp;&amp; (me-&gt;fork[m] == USED));
me-&gt;fork[m] = FREE;
me-&gt;fork[n] = FREE;</action>
<tran_glyph conn="4,63,3,-1,15">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,45,34,20">
<entry box="1,2,18,4"/>
<exit box="1,6,18,4"/>
</state_glyph>
</state>
<state_glyph node="2,5,43,62"/>
</state>
<state_diagram size="49,69"/>
</statechart>
</class>
<!--${AOs::AO_Philo[N_PHILO]}-->
<attribute name="AO_Philo[N_PHILO]" type="QActive * const" visibility="0x00" properties="0x00">
<documentation>/* opaque pointers to the Philo AOs */</documentation>
<code>= {
&amp;l_philo[0].super,
&amp;l_philo[1].super,
&amp;l_philo[2].super,
&amp;l_philo[3].super,
&amp;l_philo[4].super
};</code>
</attribute>
<!--${AOs::AO_Table}-->
<attribute name="AO_Table" type="QActive * const" visibility="0x00" properties="0x00">
<documentation>/* opaque pointer to the Table AO */</documentation>
<code>= &amp;l_table.super;</code>
</attribute>
<!--${AOs::Philo_ctor}-->
<operation name="Philo_ctor" type="void" visibility="0x00" properties="0x00">
<code>uint8_t n;
Philo *me;
for (n = 0U; n &lt; N_PHILO; ++n) {
me = &amp;l_philo[n];
QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
}</code>
</operation>
<!--${AOs::Table_ctor}-->
<operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
<code>uint8_t n;
Table *me = &amp;l_table;
QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
for (n = 0U; n &lt; N_PHILO; ++n) {
me-&gt;fork[n] = FREE;
me-&gt;isHungry[n] = 0U;
}</code>
</operation>
</package>
<!--${.}-->
<directory name=".">
<!--${.::dpp.h}-->
<file name="dpp.h">
<text>#ifndef DPP_H
#define DPP_H
enum DPPSignals {
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
DONE_SIG, /* published by Philosopher when done eating */
PAUSE_SIG, /* published by BSP to pause serving forks */
SERVE_SIG, /* published by BSP to serve re-start serving forks */
TEST_SIG, /* published by BSP to test the application */
MAX_PUB_SIG, /* the last published signal */
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
TIMEOUT_SIG, /* used by Philosophers for time events */
MAX_SIG /* the last signal */
};
$declare${Events::TableEvt}
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
$declare${AOs::Philo_ctor}
$declare${AOs::AO_Philo[N_PHILO]}
$declare${AOs::Table_ctor}
$declare${AOs::AO_Table}
#ifdef QXK_H
void Test1_ctor(void);
extern QXThread * const XT_Test1;
void Test2_ctor(void);
extern QXThread * const XT_Test2;
#endif /* QXK_H */
#endif /* DPP_H */
</text>
</file>
<!--${.::philo.c}-->
<file name="philo.c">
<text>#include &quot;qpc.h&quot;
#include &quot;dpp.h&quot;
#include &quot;bsp.h&quot;
Q_DEFINE_THIS_MODULE(&quot;philo&quot;)
/* Active object class -----------------------------------------------------*/
$declare${AOs::Philo}
/* Local objects -----------------------------------------------------------*/
static Philo l_philo[N_PHILO]; /* storage for all Philos */
#define THINK_TIME \
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
#define EAT_TIME \
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
/* helper macro to provide the ID of Philo &quot;me_&quot; */
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
/* Global objects ----------------------------------------------------------*/
$define${AOs::AO_Philo[N_PHILO]}
/* Philo definition --------------------------------------------------------*/
$define${AOs::Philo_ctor}
$define${AOs::Philo}
</text>
</file>
<!--${.::table.c}-->
<file name="table.c">
<text>#include &quot;qpc.h&quot;
#include &quot;dpp.h&quot;
#include &quot;bsp.h&quot;
Q_DEFINE_THIS_MODULE(&quot;table&quot;)
/* Active object class -----------------------------------------------------*/
$declare${AOs::Table}
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
#define FREE ((uint8_t)0)
#define USED ((uint8_t)1)
/* Local objects -----------------------------------------------------------*/
static Table l_table; /* the single instance of the Table active object */
/* Global-scope objects ----------------------------------------------------*/
$define${AOs::AO_Table}
/*..........................................................................*/
$define${AOs::Table_ctor}
$define${AOs::Table}
</text>
</file>
</directory>
</model>

View File

@ -0,0 +1,95 @@
/*****************************************************************************
* Last updated for version 6.9.4
* Last updated on 2021-12-05
*
* Q u a n t u m L e a P s
* ------------------------
* Modern Embedded Software
*
* Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alternatively, this program may be distributed and modified under the
* terms of Quantum Leaps commercial licenses, which expressly supersede
* the GNU General Public License and are specifically designed for
* licensees interested in retaining the proprietary status of their code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <www.gnu.org/licenses/>.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*****************************************************************************/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
Q_DEFINE_THIS_FILE
/* Local-scope objects -----------------------------------------------------*/
static QEvt const *l_tableQueueSto[N_PHILO];
static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
static QSubscrList l_subscrSto[MAX_PUB_SIG];
static union SmallEvents {
void *e0; /* minimum event size */
uint8_t e1[sizeof(TableEvt)];
/* ... other event types to go into this pool */
} l_smlPoolSto[2*N_PHILO + 10]; /* storage for the small event pool */
static ULONG l_philoStk[N_PHILO][256]; /* stacks for the Philosophers */
static ULONG l_tableStk[256]; /* stack for the Table */
/*..........................................................................*/
int main() {
Philo_ctor(); /* instantiate all Philosopher active objects */
Table_ctor(); /* instantiate the Table active object */
tx_kernel_enter();
return 0; /* tx_kernel_enter() does not return */
}
/*..........................................................................*/
void tx_application_define(void *first_unused_memory) {
uint8_t n;
(void)first_unused_memory; /* unused parameter */
BSP_init(); /* initialize the Board Support Package */
QF_init(); /* initialize the framework and the underlying RT kernel */
QF_psInit(l_subscrSto, Q_DIM(l_subscrSto)); /* init publish-subscribe */
/* initialize event pools... */
QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
QS_OBJ_DICTIONARY(l_smlPoolSto);
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
QS_OBJ_DICTIONARY(AO_Philo[2]);
QS_OBJ_DICTIONARY(AO_Philo[3]);
QS_OBJ_DICTIONARY(AO_Philo[4]);
for (n = 0; n < N_PHILO; ++n) { /* start the active objects... */
QActive_setAttr(AO_Philo[n], THREAD_NAME_ATTR, "Philo");
QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
l_philoStk[n], sizeof(l_philoStk[n]), (QEvt *)0);
}
QActive_setAttr(AO_Table, THREAD_NAME_ATTR, "Table");
QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
l_tableQueueSto, Q_DIM(l_tableQueueSto),
l_tableStk, sizeof(l_tableStk), (QEvt *)0);
(void)QF_run();
}

View File

@ -0,0 +1,227 @@
/*.$file${.::philo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::philo.c}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/*.$endhead${.::philo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
Q_DEFINE_THIS_MODULE("philo")
/* Active object class -----------------------------------------------------*/
/*.$declare${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
typedef struct {
/* protected: */
QActive super;
/* private: */
QTimeEvt timeEvt;
} Philo;
/* protected: */
static QState Philo_initial(Philo * const me, void const * const par);
static QState Philo_thinking(Philo * const me, QEvt const * const e);
static QState Philo_hungry(Philo * const me, QEvt const * const e);
static QState Philo_eating(Philo * const me, QEvt const * const e);
/*.$enddecl${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* Local objects -----------------------------------------------------------*/
static Philo l_philo[N_PHILO]; /* storage for all Philos */
#define THINK_TIME \
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
#define EAT_TIME \
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
/* helper macro to provide the ID of Philo "me_" */
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
/* Global objects ----------------------------------------------------------*/
/*.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*. Check for the minimum required QP version */
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpc version 6.9.0 or higher required
#endif
/*.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* opaque pointers to the Philo AOs */
/*.${AOs::AO_Philo[N_PHILO]} ...............................................*/
QActive * const AO_Philo[N_PHILO] = {
&l_philo[0].super,
&l_philo[1].super,
&l_philo[2].super,
&l_philo[3].super,
&l_philo[4].super
};
/*.$enddef${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* Philo definition --------------------------------------------------------*/
/*.$define${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
void Philo_ctor(void) {
uint8_t n;
Philo *me;
for (n = 0U; n < N_PHILO; ++n) {
me = &l_philo[n];
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
}
}
/*.$enddef${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
/*.${AOs::Philo::SM} .......................................................*/
static QState Philo_initial(Philo * const me, void const * const par) {
/*.${AOs::Philo::SM::initial} */
static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
(void)par; /* unused parameter */
if (registered == (uint8_t)0) {
registered = (uint8_t)1;
QS_OBJ_DICTIONARY(&l_philo[0].timeEvt);
QS_OBJ_DICTIONARY(&l_philo[1].timeEvt);
QS_OBJ_DICTIONARY(&l_philo[2].timeEvt);
QS_OBJ_DICTIONARY(&l_philo[3].timeEvt);
QS_OBJ_DICTIONARY(&l_philo[4].timeEvt);
QS_FUN_DICTIONARY(&Philo_initial);
QS_FUN_DICTIONARY(&Philo_thinking);
QS_FUN_DICTIONARY(&Philo_hungry);
QS_FUN_DICTIONARY(&Philo_eating);
}
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
QActive_subscribe(&me->super, EAT_SIG);
QActive_subscribe(&me->super, TEST_SIG);
return Q_TRAN(&Philo_thinking);
}
/*.${AOs::Philo::SM::thinking} .............................................*/
static QState Philo_thinking(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::thinking} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking} */
case Q_EXIT_SIG: {
QTimeEvt_disarm(&me->timeEvt);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_hungry);
break;
}
/*.${AOs::Philo::SM::thinking::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
Q_ASSERT_ID(10, Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
status_ = Q_HANDLED();
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
/*.${AOs::Philo::SM::hungry} ...............................................*/
static QState Philo_hungry(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::hungry} */
case Q_ENTRY_SIG: {
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe->philoNum = PHILO_ID(me);
QACTIVE_POST(AO_Table, &pe->super, me);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::hungry::EAT} */
case EAT_SIG: {
/*.${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~} */
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
status_ = Q_TRAN(&Philo_eating);
}
else {
status_ = Q_UNHANDLED();
}
break;
}
/*.${AOs::Philo::SM::hungry::DONE} */
case DONE_SIG: {
/* DONE must be for other Philos than this one */
Q_ASSERT_ID(20, Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
status_ = Q_HANDLED();
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
/*.${AOs::Philo::SM::eating} ...............................................*/
static QState Philo_eating(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::eating} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating} */
case Q_EXIT_SIG: {
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe->philoNum = PHILO_ID(me);
QF_PUBLISH(&pe->super, &me->super);
QTimeEvt_disarm(&me->timeEvt);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_thinking);
break;
}
/*.${AOs::Philo::SM::eating::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
Q_ASSERT_ID(30, Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
status_ = Q_HANDLED();
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
/*.$enddef${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

View File

@ -0,0 +1,294 @@
/*.$file${.::table.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::table.c}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/*.$endhead${.::table.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
Q_DEFINE_THIS_MODULE("table")
/* Active object class -----------------------------------------------------*/
/*.$declare${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table} ...........................................................*/
typedef struct {
/* protected: */
QActive super;
/* private: */
uint8_t fork[N_PHILO];
uint8_t isHungry[N_PHILO];
} Table;
/* protected: */
static QState Table_initial(Table * const me, void const * const par);
static QState Table_active(Table * const me, QEvt const * const e);
static QState Table_serving(Table * const me, QEvt const * const e);
static QState Table_paused(Table * const me, QEvt const * const e);
/*.$enddecl${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
#define FREE ((uint8_t)0)
#define USED ((uint8_t)1)
/* Local objects -----------------------------------------------------------*/
static Table l_table; /* the single instance of the Table active object */
/* Global-scope objects ----------------------------------------------------*/
/*.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*. Check for the minimum required QP version */
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpc version 6.9.0 or higher required
#endif
/*.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* opaque pointer to the Table AO */
/*.${AOs::AO_Table} ........................................................*/
QActive * const AO_Table = &l_table.super;
/*.$enddef${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*..........................................................................*/
/*.$define${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
void Table_ctor(void) {
uint8_t n;
Table *me = &l_table;
QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
for (n = 0U; n < N_PHILO; ++n) {
me->fork[n] = FREE;
me->isHungry[n] = 0U;
}
}
/*.$enddef${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table} ...........................................................*/
/*.${AOs::Table::SM} .......................................................*/
static QState Table_initial(Table * const me, void const * const par) {
/*.${AOs::Table::SM::initial} */
uint8_t n;
(void)par; /* unused parameter */
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
QS_SIG_DICTIONARY(SERVE_SIG, (void *)0);
QS_SIG_DICTIONARY(TEST_SIG, (void *)0);
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
QActive_subscribe(&me->super, DONE_SIG);
QActive_subscribe(&me->super, PAUSE_SIG);
QActive_subscribe(&me->super, SERVE_SIG);
QActive_subscribe(&me->super, TEST_SIG);
for (n = 0U; n < N_PHILO; ++n) {
me->fork[n] = FREE;
me->isHungry[n] = 0U;
BSP_displayPhilStat(n, "thinking");
}
QS_FUN_DICTIONARY(&Table_active);
QS_FUN_DICTIONARY(&Table_serving);
QS_FUN_DICTIONARY(&Table_paused);
return Q_TRAN(&Table_serving);
}
/*.${AOs::Table::SM::active} ...............................................*/
static QState Table_active(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::EAT} */
case EAT_SIG: {
Q_ERROR_ID(60);
status_ = Q_HANDLED();
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
/*.${AOs::Table::SM::active::serving} ......................................*/
static QState Table_serving(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::serving} */
case Q_ENTRY_SIG: {
uint8_t n;
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
if ((me->isHungry[n] != 0U)
&& (me->fork[LEFT(n)] == FREE)
&& (me->fork[n] == FREE))
{
TableEvt *te;
me->fork[LEFT(n)] = USED;
me->fork[n] = USED;
te = Q_NEW(TableEvt, EAT_SIG);
te->philoNum = n;
QF_PUBLISH(&te->super, &me->super);
me->isHungry[n] = 0U;
BSP_displayPhilStat(n, "eating ");
}
}
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::serving::HUNGRY} */
case HUNGRY_SIG: {
uint8_t n, m;
n = Q_EVT_CAST(TableEvt)->philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(40, (n < N_PHILO) && (me->isHungry[n] == 0U));
BSP_displayPhilStat(n, "hungry ");
m = LEFT(n);
/*.${AOs::Table::SM::active::serving::HUNGRY::[bothfree]} */
if ((me->fork[m] == FREE) && (me->fork[n] == FREE)) {
TableEvt *pe;
me->fork[m] = USED;
me->fork[n] = USED;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = n;
QF_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(n, "eating ");
status_ = Q_HANDLED();
}
/*.${AOs::Table::SM::active::serving::HUNGRY::[else]} */
else {
me->isHungry[n] = 1U;
status_ = Q_HANDLED();
}
break;
}
/*.${AOs::Table::SM::active::serving::DONE} */
case DONE_SIG: {
uint8_t n, m;
TableEvt *pe;
n = Q_EVT_CAST(TableEvt)->philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(50, (n < N_PHILO) && (me->isHungry[n] == 0U));
BSP_displayPhilStat(n, "thinking");
m = LEFT(n);
/* both forks of Phil[n] must be used */
Q_ASSERT_ID(51, (me->fork[n] == USED) && (me->fork[m] == USED));
me->fork[m] = FREE;
me->fork[n] = FREE;
m = RIGHT(n); /* check the right neighbor */
if ((me->isHungry[m] != 0U) && (me->fork[m] == FREE)) {
me->fork[n] = USED;
me->fork[m] = USED;
me->isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = m;
QF_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(m, "eating ");
}
m = LEFT(n); /* check the left neighbor */
n = LEFT(m); /* left fork of the left neighbor */
if ((me->isHungry[m] != 0U) && (me->fork[n] == FREE)) {
me->fork[m] = USED;
me->fork[n] = USED;
me->isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = m;
QF_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(m, "eating ");
}
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::serving::PAUSE} */
case PAUSE_SIG: {
status_ = Q_TRAN(&Table_paused);
break;
}
default: {
status_ = Q_SUPER(&Table_active);
break;
}
}
return status_;
}
/*.${AOs::Table::SM::active::paused} .......................................*/
static QState Table_paused(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::paused} */
case Q_ENTRY_SIG: {
BSP_displayPaused(1U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused} */
case Q_EXIT_SIG: {
BSP_displayPaused(0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused::SERVE} */
case SERVE_SIG: {
status_ = Q_TRAN(&Table_serving);
break;
}
/*.${AOs::Table::SM::active::paused::HUNGRY} */
case HUNGRY_SIG: {
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
/* philo ID must be in range and he must be not hungry */
Q_ASSERT_ID(60, (n < N_PHILO) && (me->isHungry[n] == 0U));
me->isHungry[n] = 1U;
BSP_displayPhilStat(n, "hungry ");
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused::DONE} */
case DONE_SIG: {
uint8_t n, m;
n = Q_EVT_CAST(TableEvt)->philoNum;
/* phil ID must be in range and he must be not hungry */
Q_ASSERT_ID(70, (n < N_PHILO) && (me->isHungry[n] == 0U));
BSP_displayPhilStat(n, "thinking");
m = LEFT(n);
/* both forks of Phil[n] must be used */
Q_ASSERT_ID(71, (me->fork[n] == USED) && (me->fork[m] == USED));
me->fork[m] = FREE;
me->fork[n] = FREE;
status_ = Q_HANDLED();
break;
}
default: {
status_ = Q_SUPER(&Table_active);
break;
}
}
return status_;
}
/*.$enddef${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

View File

@ -0,0 +1,36 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dpp", "dpp.vcxproj", "{8CC465F7-872E-4D03-B93C-1B64858B4E11}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
QSpy|Win32 = QSpy|Win32
QSpy|x64 = QSpy|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Debug|Win32.ActiveCfg = Debug|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Debug|Win32.Build.0 = Debug|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Debug|x64.ActiveCfg = Debug|x64
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Debug|x64.Build.0 = Debug|x64
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|Win32.ActiveCfg = QSpy|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|Win32.Build.0 = QSpy|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|x64.ActiveCfg = QSpy|x64
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|x64.Build.0 = QSpy|x64
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Release|Win32.ActiveCfg = Release|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Release|Win32.Build.0 = Release|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Release|x64.ActiveCfg = Release|x64
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81C44522-3086-4233-AE6E-002359F230DE}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,534 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="QSpy|x64">
<Configuration>QSpy</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="QSpy|Win32">
<Configuration>QSpy</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_allocate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_release.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_allocate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_release.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_set.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_set_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_flush.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_front_send.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_receive.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_send.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_send_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_ceiling_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_put_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_entry_exit_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_preemption_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_priority_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_relinquish.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_reset.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_resume.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_suspend.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_terminate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_time_slice_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_wait_abort.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_activate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_deactivate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_allocate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_release.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_allocate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_search.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_release.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_set.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_set_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_high_level.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_kernel_enter.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_kernel_setup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_misra.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_priority_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_flush.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_front_send.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_receive.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_send.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_send_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_ceiling_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_cleanup.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_prioritize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_put.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_put_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_entry_exit_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_identify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_preemption_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_priority_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_relinquish.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_reset.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_resume.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_shell_entry.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_sleep.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_analyze.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_error_handler.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_error_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_suspend.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_preempt_check.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_resume.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_suspend.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_terminate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_timeout.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_time_slice.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_time_slice_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_wait_abort.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_activate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_change.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_create.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_deactivate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_delete.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_expiration_process.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_performance_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_performance_system_info_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_system_activate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_system_deactivate.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_thread_entry.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_time_get.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_time_set.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_buffer_full_notify.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_disable.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_enable.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_event_filter.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_event_unfilter.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_initialize.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_interrupt_control.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_isr_enter_insert.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_isr_exit_insert.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_object_register.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_object_unregister.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_user_event_insert.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_initialize_low_level.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_context_restore.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_context_save.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_interrupt_control.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_schedule.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_stack_build.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_system_return.c" />
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_timer_interrupt.c" />
<ClCompile Include="..\..\..\..\..\include\qstamp.c" />
<ClCompile Include="..\..\..\..\..\ports\threadx\qf_port.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qep_hsm.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qep_msm.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_act.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_defer.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_dyn.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_mem.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_ps.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_qact.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_qeq.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_qmact.c" />
<ClCompile Include="..\..\..\..\..\src\qf\qf_time.c" />
<ClCompile Include="..\..\..\..\..\src\qs\qs.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_64bit.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_fp.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_rx.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\bsp.c" />
<ClCompile Include="..\main.c" />
<ClCompile Include="..\philo.c" />
<ClCompile Include="..\table.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\ports\threadx\qep_port.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\..\..\..\..\ports\threadx\qf_port.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\..\..\..\..\ports\threadx\qs_port.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\bsp.h" />
<ClInclude Include="..\dpp.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8CC465F7-872E-4D03-B93C-1B64858B4E11}</ProjectGuid>
<RootNamespace>dpp</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='QSpy|x64'">true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>Q_SPY;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..;../../../../../include;../../../../../src;../../../../../ports/threadx;../../../../../3rd_party/threadx/common/inc/;../../../../../3rd_party/threadx/ports/win32/vs_2019/inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>Q_SPY;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4127</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,687 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\bsp.c">
<Filter>Application</Filter>
</ClCompile>
<ClCompile Include="..\main.c">
<Filter>Application</Filter>
</ClCompile>
<ClCompile Include="..\philo.c">
<Filter>Application</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\include\qstamp.c">
<Filter>Application</Filter>
</ClCompile>
<ClCompile Include="..\table.c">
<Filter>Application</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qep_hsm.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qep_msm.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_act.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_defer.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_dyn.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_ps.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_qact.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_qeq.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_qmact.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_time.c">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\ports\threadx\qf_port.c">
<Filter>QP_port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_initialize_low_level.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_context_restore.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_context_save.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_interrupt_control.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_schedule.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_stack_build.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_thread_system_return.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\ports\win32\vs_2019\src\tx_timer_interrupt.c">
<Filter>ThreadX\port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_allocate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_pool_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_block_release.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_allocate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_pool_search.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_byte_release.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_set.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_event_flags_set_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_high_level.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_kernel_enter.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_initialize_kernel_setup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_misra.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_priority_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_mutex_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_flush.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_front_send.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_receive.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_send.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_queue_send_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_ceiling_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_cleanup.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_semaphore_put_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_entry_exit_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_identify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_preemption_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_priority_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_relinquish.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_reset.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_resume.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_shell_entry.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_sleep.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_analyze.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_error_handler.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_stack_error_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_suspend.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_preempt_check.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_resume.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_system_suspend.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_terminate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_time_slice.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_time_slice_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_timeout.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_thread_wait_abort.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_time_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_time_set.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_activate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_deactivate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_expiration_process.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_performance_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_performance_system_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_system_activate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_system_deactivate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_timer_thread_entry.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_buffer_full_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_disable.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_enable.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_event_filter.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_event_unfilter.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_initialize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_interrupt_control.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_isr_enter_insert.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_isr_exit_insert.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_object_register.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_object_unregister.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\tx_trace_user_event_insert.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_allocate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_pool_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_block_release.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_allocate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_pool_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_byte_release.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_set.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_event_flags_set_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_mutex_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_flush.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_front_send.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_receive.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_send.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_queue_send_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_ceiling_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_prioritize.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_put.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_semaphore_put_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_entry_exit_notify.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_preemption_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_priority_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_relinquish.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_reset.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_resume.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_suspend.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_terminate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_time_slice_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_thread_wait_abort.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_activate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_change.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_create.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_deactivate.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_delete.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\3rd_party\threadx\common\src\txe_timer_info_get.c">
<Filter>ThreadX\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs.c">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_64bit.c">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_fp.c">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qs\qs_rx.c">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\src\qf\qf_mem.c">
<Filter>QP</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\bsp.h">
<Filter>Application</Filter>
</ClInclude>
<ClInclude Include="..\dpp.h">
<Filter>Application</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\ports\threadx\qep_port.h">
<Filter>QP_port</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\ports\threadx\qf_port.h">
<Filter>QP_port</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\ports\threadx\qs_port.h">
<Filter>QP_port</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Application">
<UniqueIdentifier>{0b727001-144d-4617-8d15-1011a12cf288}</UniqueIdentifier>
</Filter>
<Filter Include="ThreadX">
<UniqueIdentifier>{add14520-3b44-49c7-9197-b6768f97aa7d}</UniqueIdentifier>
</Filter>
<Filter Include="ThreadX\common">
<UniqueIdentifier>{e9a217a4-2a5e-4ccb-af7d-1ffe6428b16d}</UniqueIdentifier>
</Filter>
<Filter Include="ThreadX\port">
<UniqueIdentifier>{d400d7ba-8989-4140-b470-7c572d97558d}</UniqueIdentifier>
</Filter>
<Filter Include="QS">
<UniqueIdentifier>{503258f0-f0c5-424d-8c86-efbe718de482}</UniqueIdentifier>
</Filter>
<Filter Include="QP">
<UniqueIdentifier>{4df73fc6-8803-490a-8491-c7e8a5324783}</UniqueIdentifier>
</Filter>
<Filter Include="QP_port">
<UniqueIdentifier>{b3aab5be-7f8a-4001-8984-76daf785424f}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -117,10 +117,6 @@
<pMon>BIN\lmidk-agdi.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
@ -918,6 +914,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\src\qf\qf_mem.c</PathWithFileName>
<FilenameWithoutPath>qf_mem.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@ -928,7 +936,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>27</FileNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -940,7 +948,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>28</FileNumber>
<FileNumber>29</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -952,7 +960,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>29</FileNumber>
<FileNumber>30</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -964,7 +972,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>30</FileNumber>
<FileNumber>31</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -984,7 +992,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>31</FileNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -996,7 +1004,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>32</FileNumber>
<FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1008,7 +1016,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>33</FileNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1020,7 +1028,7 @@
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>34</FileNumber>
<FileNumber>35</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1040,7 +1048,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>35</FileNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1052,7 +1060,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>36</FileNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1064,7 +1072,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>37</FileNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1076,7 +1084,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>38</FileNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1088,7 +1096,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>39</FileNumber>
<FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1100,7 +1108,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>40</FileNumber>
<FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1112,7 +1120,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>41</FileNumber>
<FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1124,7 +1132,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>42</FileNumber>
<FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1136,7 +1144,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>43</FileNumber>
<FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1148,7 +1156,7 @@
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>44</FileNumber>
<FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1168,7 +1176,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>45</FileNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1180,7 +1188,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>46</FileNumber>
<FileNumber>47</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1192,7 +1200,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>47</FileNumber>
<FileNumber>48</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@ -1204,7 +1212,7 @@
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>48</FileNumber>
<FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

View File

@ -10,7 +10,7 @@
<TargetName>dpp-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -522,6 +523,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.c</FilePath>
</File>
<File>
<FileName>qf_mem.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.c</FilePath>
</File>
</Files>
</Group>
<Group>
@ -610,7 +616,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -904,6 +910,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1070,7 +1077,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1241,6 +1248,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.c</FilePath>
</File>
<File>
<FileName>qf_mem.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.c</FilePath>
</File>
</Files>
</Group>
<Group>
@ -1329,7 +1341,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1623,6 +1635,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1789,7 +1802,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1960,6 +1973,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_time.c</FilePath>
</File>
<File>
<FileName>qf_mem.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\src\qf\qf_mem.c</FilePath>
</File>
</Files>
</Group>
<Group>

Some files were not shown because too many files have changed in this diff Show More