This commit is contained in:
Quantum Leaps 2016-04-01 13:55:34 -04:00
parent 805e638eae
commit 8601e4bc74
107 changed files with 13420 additions and 8248 deletions

View File

@ -354,7 +354,6 @@ int const g_pfnVectors[] = {
/* reset handler -----------------------------------------------------------*/
__attribute__((naked)) void Reset_Handler(void);
void Reset_Handler(void) {
extern int main(void);
extern int __libc_init_array(void);

View File

@ -2,7 +2,7 @@
//
// gpio.h - Defines and Macros for GPIO API.
//
// Copyright (c) 2005-2012 Texas Instruments Incorporated. All rights reserved.
// Copyright (c) 2005-2015 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
@ -33,12 +33,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 9453 of the Stellaris Peripheral Driver Library.
// This is part of revision 2.1.2.111 of the Tiva Peripheral Driver Library.
//
//*****************************************************************************
#ifndef __GPIO_H__
#define __GPIO_H__
#ifndef __DRIVERLIB_GPIO_H__
#define __DRIVERLIB_GPIO_H__
//*****************************************************************************
//
@ -53,8 +53,8 @@ extern "C"
//*****************************************************************************
//
// The following values define the bit field for the ucPins argument to several
// of the APIs.
// The following values define the bit field for the ui8Pins argument to
// several of the APIs.
//
//*****************************************************************************
#define GPIO_PIN_0 0x00000001 // GPIO pin 0
@ -68,7 +68,7 @@ extern "C"
//*****************************************************************************
//
// Values that can be passed to GPIODirModeSet as the ulPinIO parameter, and
// Values that can be passed to GPIODirModeSet as the ui32PinIO parameter, and
// returned from GPIODirModeGet.
//
//*****************************************************************************
@ -78,99 +78,116 @@ extern "C"
//*****************************************************************************
//
// Values that can be passed to GPIOIntTypeSet as the ulIntType parameter, and
// returned from GPIOIntTypeGet.
// Values that can be passed to GPIOIntTypeSet as the ui32IntType parameter,
// and returned from GPIOIntTypeGet.
//
//*****************************************************************************
#define GPIO_FALLING_EDGE 0x00000000 // Interrupt on falling edge
#define GPIO_RISING_EDGE 0x00000004 // Interrupt on rising edge
#define GPIO_BOTH_EDGES 0x00000001 // Interrupt on both edges
#define GPIO_LOW_LEVEL 0x00000002 // Interrupt on low level
#define GPIO_HIGH_LEVEL 0x00000007 // Interrupt on high level
#define GPIO_HIGH_LEVEL 0x00000006 // Interrupt on high level
#define GPIO_DISCRETE_INT 0x00010000 // Interrupt for individual pins
//*****************************************************************************
//
// Values that can be passed to GPIOPadConfigSet as the ulStrength parameter,
// and returned by GPIOPadConfigGet in the *pulStrength parameter.
// Values that can be passed to GPIOPadConfigSet as the ui32Strength parameter,
// and returned by GPIOPadConfigGet in the *pui32Strength parameter.
//
//*****************************************************************************
#define GPIO_STRENGTH_2MA 0x00000001 // 2mA drive strength
#define GPIO_STRENGTH_4MA 0x00000002 // 4mA drive strength
#define GPIO_STRENGTH_8MA 0x00000004 // 8mA drive strength
#define GPIO_STRENGTH_8MA_SC 0x0000000C // 8mA drive with slew rate control
#define GPIO_STRENGTH_6MA 0x00000065 // 6mA drive strength
#define GPIO_STRENGTH_8MA 0x00000066 // 8mA drive strength
#define GPIO_STRENGTH_8MA_SC 0x0000006E // 8mA drive with slew rate control
#define GPIO_STRENGTH_10MA 0x00000075 // 10mA drive strength
#define GPIO_STRENGTH_12MA 0x00000077 // 12mA drive strength
//*****************************************************************************
//
// Values that can be passed to GPIOPadConfigSet as the ulPadType parameter,
// and returned by GPIOPadConfigGet in the *pulPadType parameter.
// Values that can be passed to GPIOPadConfigSet as the ui32PadType parameter,
// and returned by GPIOPadConfigGet in the *pui32PadType parameter.
//
//*****************************************************************************
#define GPIO_PIN_TYPE_STD 0x00000008 // Push-pull
#define GPIO_PIN_TYPE_STD_WPU 0x0000000A // Push-pull with weak pull-up
#define GPIO_PIN_TYPE_STD_WPD 0x0000000C // Push-pull with weak pull-down
#define GPIO_PIN_TYPE_OD 0x00000009 // Open-drain
#define GPIO_PIN_TYPE_OD_WPU 0x0000000B // Open-drain with weak pull-up
#define GPIO_PIN_TYPE_OD_WPD 0x0000000D // Open-drain with weak pull-down
#define GPIO_PIN_TYPE_ANALOG 0x00000000 // Analog comparator
#define GPIO_PIN_TYPE_WAKE_HIGH 0x00000208 // Hibernate wake, high
#define GPIO_PIN_TYPE_WAKE_LOW 0x00000108 // Hibernate wake, low
//*****************************************************************************
//
// Values that can be passed to GPIOIntEnable() and GPIOIntDisable() functions
// in the ui32IntFlags parameter.
//
//*****************************************************************************
#define GPIO_INT_PIN_0 0x00000001
#define GPIO_INT_PIN_1 0x00000002
#define GPIO_INT_PIN_2 0x00000004
#define GPIO_INT_PIN_3 0x00000008
#define GPIO_INT_PIN_4 0x00000010
#define GPIO_INT_PIN_5 0x00000020
#define GPIO_INT_PIN_6 0x00000040
#define GPIO_INT_PIN_7 0x00000080
#define GPIO_INT_DMA 0x00000100
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
unsigned long ulPinIO);
extern unsigned long GPIODirModeGet(unsigned long ulPort, unsigned char ucPin);
extern void GPIOIntTypeSet(unsigned long ulPort, unsigned char ucPins,
unsigned long ulIntType);
extern unsigned long GPIOIntTypeGet(unsigned long ulPort, unsigned char ucPin);
extern void GPIOPadConfigSet(unsigned long ulPort, unsigned char ucPins,
unsigned long ulStrength,
unsigned long ulPadType);
extern void GPIOPadConfigGet(unsigned long ulPort, unsigned char ucPin,
unsigned long *pulStrength,
unsigned long *pulPadType);
extern void GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins);
extern long GPIOPinIntStatus(unsigned long ulPort, tBoolean bMasked);
extern void GPIOPinIntClear(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPortIntRegister(unsigned long ulPort,
void (*pfnIntHandler)(void));
extern void GPIOPortIntUnregister(unsigned long ulPort);
extern long GPIOPinRead(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins,
unsigned char ucVal);
extern void GPIOPinConfigure(unsigned long ulPinConfig);
extern void GPIOPinTypeADC(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeCAN(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeComparator(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeEPI(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeEthernetLED(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeEthernetMII(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeFan(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeGPIOInput(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeGPIOOutputOD(unsigned long ulPort,
unsigned char ucPins);
extern void GPIOPinTypeI2C(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeI2CSCL(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeLPC(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypePECIRx(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypePECITx(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypePWM(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeQEI(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeTimer(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeUART(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeUSBAnalog(unsigned long ulPort, unsigned char ucPins);
extern void GPIOPinTypeUSBDigital(unsigned long ulPort, unsigned char ucPins);
extern void GPIODMATriggerEnable(unsigned long ulPort, unsigned char ucPins);
extern void GPIODMATriggerDisable(unsigned long ulPort, unsigned char ucPins);
extern void GPIOADCTriggerEnable(unsigned long ulPort, unsigned char ucPins);
extern void GPIOADCTriggerDisable(unsigned long ulPort, unsigned char ucPins);
extern void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins,
uint32_t ui32PinIO);
extern uint32_t GPIODirModeGet(uint32_t ui32Port, uint8_t ui8Pin);
extern void GPIOIntTypeSet(uint32_t ui32Port, uint8_t ui8Pins,
uint32_t ui32IntType);
extern uint32_t GPIOIntTypeGet(uint32_t ui32Port, uint8_t ui8Pin);
extern void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins,
uint32_t ui32Strength, uint32_t ui32PadType);
extern void GPIOPadConfigGet(uint32_t ui32Port, uint8_t ui8Pin,
uint32_t *pui32Strength, uint32_t *pui32PadType);
extern void GPIOIntEnable(uint32_t ui32Port, uint32_t ui32IntFlags);
extern void GPIOIntDisable(uint32_t ui32Port, uint32_t ui32IntFlags);
extern uint32_t GPIOIntStatus(uint32_t ui32Port, bool bMasked);
extern void GPIOIntClear(uint32_t ui32Port, uint32_t ui32IntFlags);
extern void GPIOIntRegister(uint32_t ui32Port, void (*pfnIntHandler)(void));
extern void GPIOIntUnregister(uint32_t ui32Port);
extern int32_t GPIOPinRead(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinWrite(uint32_t ui32Port, uint8_t ui8Pins, uint8_t ui8Val);
extern void GPIOPinConfigure(uint32_t ui32PinConfig);
extern void GPIOPinTypeADC(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeCAN(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeComparator(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeComparatorOutput(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeDIVSCLK(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeEPI(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeEthernetLED(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeEthernetMII(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeGPIOInput(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeGPIOOutput(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeGPIOOutputOD(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeHibernateRTCCLK(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeI2C(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeI2CSCL(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeLCD(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeOneWire(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypePWM(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeQEI(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeSSI(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeTimer(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeTrace(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeUART(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeUSBAnalog(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeUSBDigital(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeWakeHigh(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOPinTypeWakeLow(uint32_t ui32Port, uint8_t ui8Pins);
extern uint32_t GPIOPinWakeStatus(uint32_t ui32Port);
extern void GPIODMATriggerEnable(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIODMATriggerDisable(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOADCTriggerEnable(uint32_t ui32Port, uint8_t ui8Pins);
extern void GPIOADCTriggerDisable(uint32_t ui32Port, uint8_t ui8Pins);
//*****************************************************************************
//
@ -181,4 +198,4 @@ extern void GPIOADCTriggerDisable(unsigned long ulPort, unsigned char ucPins);
}
#endif
#endif // __GPIO_H__
#endif // __DRIVERLIB_GPIO_H__

View File

@ -520,8 +520,8 @@ PWM1Gen1_IRQHandler
PWM1Gen2_IRQHandler
PWM1Gen3_IRQHandler
PWM1Fault_IRQHandler
MOV r0,#0
MOV r1,#-1 ; 0xFFFFFFF
MOVS r0,#0
MOVS r1,#-1 ; 0xFFFFFFF
B assert_failed
;******************************************************************************

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
* Purpose: startup file for STM32L1xx Cortex-M3 device.
* Should be used with GCC 'GNU Tools ARM Embedded'
* Version: CMSIS 4.3.0
* Date: 20 August 2015
* Date: 2 March 2016
*
* Created from the CMSIS template for the specified device
* Quantum Leaps, www.state-machine.com
@ -146,9 +146,9 @@ int const g_pfnVectors[] = {
(int)&Reset_Handler, /* Reset Handler */
(int)&NMI_Handler, /* NMI Handler */
(int)&HardFault_Handler, /* Hard Fault Handler */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
(int)&MemManage_Handler, /* The MPU fault handler */
(int)&BusFault_Handler, /* The bus fault handler */
(int)&UsageFault_Handler, /* The usage fault handler */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */

View File

@ -0,0 +1,452 @@
;/***************************************************************************/
; * @file startup_stm32f4xx.s for ThreadX; IAR ARM assembler
; * @brief CMSIS Cortex-M4F Core Device Startup File for STM32F40xx devices
; * @version CMSIS 4.3.0
; * @date 20 August 2015
; *
; * @description
; * Created from the CMSIS template for the specified device
; * Quantum Leaps, www.state-machine.com
; *
; * @attention
; * Adapted for ThreadX STM32demo library, which is NOT CMSIS-compiliant.
; * Specifically, the standard Cortex-M exception names required by
; * ThreadX are different than prescribed by CMSIS.
; *
; * @note
; * The function assert_failed defined at the end of this file defines
; * the error/assertion handling policy for the application and might
; * need to be customized for each project. This function is defined in
; * assembly to re-set the stack pointer, in case it is corrupted by the
; * time assert_failed is called.
; *
; ***************************************************************************/
;/* Copyright (c) 2012 ARM LIMITED
;
; All rights reserved.
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; - Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; - Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; - Neither the name of ARM nor the names of its contributors may be used
; to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;---------------------------------------------------------------------------*/
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
PUBLIC __vector_table
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
;; QL: added for ThreadX
PUBLIC __tx_vectors
EXTERN __tx_SVCallHandler
EXTERN __tx_PendSVHandler
EXTERN __tx_SysTickHandler
;******************************************************************************
;
DATA
__vector_table
__tx_vectors
DCD sfe(CSTACK)
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD MemManage_Handler ; The MPU fault handler
DCD BusFault_Handler ; The bus fault handler
DCD UsageFault_Handler ; The usage fault handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD __tx_SVCallHandler ; QL: SVCall handler (ThreadX) !!!
DCD DebugMon_Handler ; Debug monitor handler
DCD 0 ; Reserved
DCD __tx_PendSVHandler ; QL: PendSV handler (ThreadX) !!!
DCD __tx_SysTickHandler ; QL: SysTick handler (ThreadX) !!!
; IRQ handlers...
DCD WWDG_IRQHandler ; Window WatchDog
DCD PVD_IRQHandler ; PVD through EXTI Line detection
DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
DCD FLASH_IRQHandler ; FLASH
DCD RCC_IRQHandler ; RCC
DCD EXTI0_IRQHandler ; EXTI Line0
DCD EXTI1_IRQHandler ; EXTI Line1
DCD EXTI2_IRQHandler ; EXTI Line2
DCD EXTI3_IRQHandler ; EXTI Line3
DCD EXTI4_IRQHandler ; EXTI Line4
DCD DMA1_Stream0_IRQHandler ; DMA1 Stream 0
DCD DMA1_Stream1_IRQHandler ; DMA1 Stream 1
DCD DMA1_Stream2_IRQHandler ; DMA1 Stream 2
DCD DMA1_Stream3_IRQHandler ; DMA1 Stream 3
DCD DMA1_Stream4_IRQHandler ; DMA1 Stream 4
DCD DMA1_Stream5_IRQHandler ; DMA1 Stream 5
DCD DMA1_Stream6_IRQHandler ; DMA1 Stream 6
DCD ADC_IRQHandler ; ADC1, ADC2 and ADC3s
DCD CAN1_TX_IRQHandler ; CAN1 TX
DCD CAN1_RX0_IRQHandler ; CAN1 RX0
DCD CAN1_RX1_IRQHandler ; CAN1 RX1
DCD CAN1_SCE_IRQHandler ; CAN1 SCE
DCD EXTI9_5_IRQHandler ; External Line[9:5]s
DCD TIM1_BRK_TIM9_IRQHandler ; TIM1 Break and TIM9
DCD TIM1_UP_TIM10_IRQHandler ; TIM1 Update and TIM10
DCD TIM1_TRG_COM_TIM11_IRQHandler ; TIM1 Trigger and Commutation and TIM11
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
DCD TIM2_IRQHandler ; TIM2
DCD TIM3_IRQHandler ; TIM3
DCD TIM4_IRQHandler ; TIM4
DCD I2C1_EV_IRQHandler ; I2C1 Event
DCD I2C1_ER_IRQHandler ; I2C1 Error
DCD I2C2_EV_IRQHandler ; I2C2 Event
DCD I2C2_ER_IRQHandler ; I2C2 Error
DCD SPI1_IRQHandler ; SPI1
DCD SPI2_IRQHandler ; SPI2
DCD USART1_IRQHandler ; USART1
DCD USART2_IRQHandler ; USART2
DCD USART3_IRQHandler ; USART3
DCD EXTI15_10_IRQHandler ; External Line[15:10]s
DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
DCD TIM8_BRK_TIM12_IRQHandler ; TIM8 Break and TIM12
DCD TIM8_UP_TIM13_IRQHandler ; TIM8 Update and TIM13
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and TIM14
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
DCD FSMC_IRQHandler ; FSMC
DCD SDIO_IRQHandler ; SDIO
DCD TIM5_IRQHandler ; TIM5
DCD SPI3_IRQHandler ; SPI3
DCD UART4_IRQHandler ; UART4
DCD UART5_IRQHandler ; UART5
DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors
DCD TIM7_IRQHandler ; TIM7
DCD DMA2_Stream0_IRQHandler ; DMA2 Stream 0
DCD DMA2_Stream1_IRQHandler ; DMA2 Stream 1
DCD DMA2_Stream2_IRQHandler ; DMA2 Stream 2
DCD DMA2_Stream3_IRQHandler ; DMA2 Stream 3
DCD DMA2_Stream4_IRQHandler ; DMA2 Stream 4
DCD ETH_IRQHandler ; Ethernet
DCD ETH_WKUP_IRQHandler ; Ethernet Wakeup through EXTI line
DCD CAN2_TX_IRQHandler ; CAN2 TX
DCD CAN2_RX0_IRQHandler ; CAN2 RX0
DCD CAN2_RX1_IRQHandler ; CAN2 RX1
DCD CAN2_SCE_IRQHandler ; CAN2 SCE
DCD OTG_FS_IRQHandler ; USB OTG FS
DCD DMA2_Stream5_IRQHandler ; DMA2 Stream 5
DCD DMA2_Stream6_IRQHandler ; DMA2 Stream 6
DCD DMA2_Stream7_IRQHandler ; DMA2 Stream 7
DCD USART6_IRQHandler ; USART6
DCD I2C3_EV_IRQHandler ; I2C3 event
DCD I2C3_ER_IRQHandler ; I2C3 error
DCD OTG_HS_EP1_OUT_IRQHandler ; USB OTG HS End Point 1 Out
DCD OTG_HS_EP1_IN_IRQHandler ; USB OTG HS End Point 1 In
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
DCD OTG_HS_IRQHandler ; USB OTG HS
DCD DCMI_IRQHandler ; DCMI
DCD CRYP_IRQHandler ; CRYP crypto
DCD HASH_RNG_IRQHandler ; Hash and Rng
DCD FPU_IRQHandler ; FPU
__Vectors_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;******************************************************************************
;
; Weak fault handlers...
;
SECTION .text:CODE:REORDER:NOROOT(2)
;.............................................................................
PUBWEAK Reset_Handler
EXTERN SystemInit
EXTERN __iar_program_start
Reset_Handler
BL SystemInit ; CMSIS system initialization
BL __iar_program_start ; IAR startup code
;.............................................................................
PUBWEAK NMI_Handler
NMI_Handler
MOVS r0,#0
MOVS r1,#2 ; NMI exception number
B assert_failed
;.............................................................................
PUBWEAK HardFault_Handler
HardFault_Handler
MOVS r0,#0
MOVS r1,#3 ; HardFault exception number
B assert_failed
;.............................................................................
PUBWEAK MemManage_Handler
MemManage_Handler
MOVS r0,#0
MOVS r1,#4 ; MemManage exception number
B assert_failed
;.............................................................................
PUBWEAK BusFault_Handler
BusFault_Handler
MOVS r0,#0
MOVS r1,#5 ; BusFault exception number
B assert_failed
;.............................................................................
PUBWEAK UsageFault_Handler
UsageFault_Handler
MOVS r0,#0
MOVS r1,#6 ; UsageFault exception number
B assert_failed
;******************************************************************************
;
; Weak non-fault handlers...
;
PUBWEAK SVC_Handler
SVC_Handler
MOVS r0,#0
MOVS r1,#11 ; SVCall exception number
B assert_failed
;.............................................................................
PUBWEAK DebugMon_Handler
DebugMon_Handler
MOVS r0,#0
MOVS r1,#12 ; DebugMon exception number
B assert_failed
;.............................................................................
PUBWEAK PendSV_Handler
PendSV_Handler
MOVS r0,#0
MOVS r1,#14 ; PendSV exception number
B assert_failed
;.............................................................................
PUBWEAK SysTick_Handler
SysTick_Handler
MOVS r0,#0
MOVS r1,#15 ; SysTick exception number
B assert_failed
;******************************************************************************
;
; Weak IRQ handlers...
;
PUBWEAK WWDG_IRQHandler
PUBWEAK PVD_IRQHandler
PUBWEAK TAMP_STAMP_IRQHandler
PUBWEAK RTC_WKUP_IRQHandler
PUBWEAK FLASH_IRQHandler
PUBWEAK RCC_IRQHandler
PUBWEAK EXTI0_IRQHandler
PUBWEAK EXTI1_IRQHandler
PUBWEAK EXTI2_IRQHandler
PUBWEAK EXTI3_IRQHandler
PUBWEAK EXTI4_IRQHandler
PUBWEAK DMA1_Stream0_IRQHandler
PUBWEAK DMA1_Stream1_IRQHandler
PUBWEAK DMA1_Stream2_IRQHandler
PUBWEAK DMA1_Stream3_IRQHandler
PUBWEAK DMA1_Stream4_IRQHandler
PUBWEAK DMA1_Stream5_IRQHandler
PUBWEAK DMA1_Stream6_IRQHandler
PUBWEAK ADC_IRQHandler
PUBWEAK CAN1_TX_IRQHandler
PUBWEAK CAN1_RX0_IRQHandler
PUBWEAK CAN1_RX1_IRQHandler
PUBWEAK CAN1_SCE_IRQHandler
PUBWEAK EXTI9_5_IRQHandler
PUBWEAK TIM1_BRK_TIM9_IRQHandler
PUBWEAK TIM1_UP_TIM10_IRQHandler
PUBWEAK TIM1_TRG_COM_TIM11_IRQHandler
PUBWEAK TIM1_CC_IRQHandler
PUBWEAK TIM2_IRQHandler
PUBWEAK TIM3_IRQHandler
PUBWEAK TIM4_IRQHandler
PUBWEAK I2C1_EV_IRQHandler
PUBWEAK I2C1_ER_IRQHandler
PUBWEAK I2C2_EV_IRQHandler
PUBWEAK I2C2_ER_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK SPI2_IRQHandler
PUBWEAK USART1_IRQHandler
PUBWEAK USART2_IRQHandler
PUBWEAK USART3_IRQHandler
PUBWEAK EXTI15_10_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK OTG_FS_WKUP_IRQHandler
PUBWEAK TIM8_BRK_TIM12_IRQHandler
PUBWEAK TIM8_UP_TIM13_IRQHandler
PUBWEAK TIM8_TRG_COM_TIM14_IRQHandler
PUBWEAK TIM8_CC_IRQHandler
PUBWEAK DMA1_Stream7_IRQHandler
PUBWEAK FSMC_IRQHandler
PUBWEAK SDIO_IRQHandler
PUBWEAK TIM5_IRQHandler
PUBWEAK SPI3_IRQHandler
PUBWEAK UART4_IRQHandler
PUBWEAK UART5_IRQHandler
PUBWEAK TIM6_DAC_IRQHandler
PUBWEAK TIM7_IRQHandler
PUBWEAK DMA2_Stream0_IRQHandler
PUBWEAK DMA2_Stream1_IRQHandler
PUBWEAK DMA2_Stream2_IRQHandler
PUBWEAK DMA2_Stream3_IRQHandler
PUBWEAK DMA2_Stream4_IRQHandler
PUBWEAK ETH_IRQHandler
PUBWEAK ETH_WKUP_IRQHandler
PUBWEAK CAN2_TX_IRQHandler
PUBWEAK CAN2_RX0_IRQHandler
PUBWEAK CAN2_RX1_IRQHandler
PUBWEAK CAN2_SCE_IRQHandler
PUBWEAK OTG_FS_IRQHandler
PUBWEAK DMA2_Stream5_IRQHandler
PUBWEAK DMA2_Stream6_IRQHandler
PUBWEAK DMA2_Stream7_IRQHandler
PUBWEAK USART6_IRQHandler
PUBWEAK I2C3_EV_IRQHandler
PUBWEAK I2C3_ER_IRQHandler
PUBWEAK OTG_HS_EP1_OUT_IRQHandler
PUBWEAK OTG_HS_EP1_IN_IRQHandler
PUBWEAK OTG_HS_WKUP_IRQHandler
PUBWEAK OTG_HS_IRQHandler
PUBWEAK DCMI_IRQHandler
PUBWEAK CRYP_IRQHandler
PUBWEAK HASH_RNG_IRQHandler
PUBWEAK FPU_IRQHandler
WWDG_IRQHandler
PVD_IRQHandler
TAMP_STAMP_IRQHandler
RTC_WKUP_IRQHandler
FLASH_IRQHandler
RCC_IRQHandler
EXTI0_IRQHandler
EXTI1_IRQHandler
EXTI2_IRQHandler
EXTI3_IRQHandler
EXTI4_IRQHandler
DMA1_Stream0_IRQHandler
DMA1_Stream1_IRQHandler
DMA1_Stream2_IRQHandler
DMA1_Stream3_IRQHandler
DMA1_Stream4_IRQHandler
DMA1_Stream5_IRQHandler
DMA1_Stream6_IRQHandler
ADC_IRQHandler
CAN1_TX_IRQHandler
CAN1_RX0_IRQHandler
CAN1_RX1_IRQHandler
CAN1_SCE_IRQHandler
EXTI9_5_IRQHandler
TIM1_BRK_TIM9_IRQHandler
TIM1_UP_TIM10_IRQHandler
TIM1_TRG_COM_TIM11_IRQHandler
TIM1_CC_IRQHandler
TIM2_IRQHandler
TIM3_IRQHandler
TIM4_IRQHandler
I2C1_EV_IRQHandler
I2C1_ER_IRQHandler
I2C2_EV_IRQHandler
I2C2_ER_IRQHandler
SPI1_IRQHandler
SPI2_IRQHandler
USART1_IRQHandler
USART2_IRQHandler
USART3_IRQHandler
EXTI15_10_IRQHandler
RTC_Alarm_IRQHandler
OTG_FS_WKUP_IRQHandler
TIM8_BRK_TIM12_IRQHandler
TIM8_UP_TIM13_IRQHandler
TIM8_TRG_COM_TIM14_IRQHandler
TIM8_CC_IRQHandler
DMA1_Stream7_IRQHandler
FSMC_IRQHandler
SDIO_IRQHandler
TIM5_IRQHandler
SPI3_IRQHandler
UART4_IRQHandler
UART5_IRQHandler
TIM6_DAC_IRQHandler
TIM7_IRQHandler
DMA2_Stream0_IRQHandler
DMA2_Stream1_IRQHandler
DMA2_Stream2_IRQHandler
DMA2_Stream3_IRQHandler
DMA2_Stream4_IRQHandler
ETH_IRQHandler
ETH_WKUP_IRQHandler
CAN2_TX_IRQHandler
CAN2_RX0_IRQHandler
CAN2_RX1_IRQHandler
CAN2_SCE_IRQHandler
OTG_FS_IRQHandler
DMA2_Stream5_IRQHandler
DMA2_Stream6_IRQHandler
DMA2_Stream7_IRQHandler
USART6_IRQHandler
I2C3_EV_IRQHandler
I2C3_ER_IRQHandler
OTG_HS_EP1_OUT_IRQHandler
OTG_HS_EP1_IN_IRQHandler
OTG_HS_WKUP_IRQHandler
OTG_HS_IRQHandler
DCMI_IRQHandler
CRYP_IRQHandler
HASH_RNG_IRQHandler
FPU_IRQHandler
MOV r0,#0
MOV r1,#-1 ; 0xFFFFFFF
B assert_failed
;******************************************************************************
;
; The function assert_failed defines the error/assertion handling policy
; for the application. After making sure that the stack is OK, this function
; calls Q_onAssert, which should NOT return (typically reset the CPU).
;
; NOTE: the function Q_onAssert should NOT return.
;
; The C proptotype of the assert_failed() and Q_onAssert() functions are:
; void assert_failed(char const *file, int line);
; void Q_onAssert (char const *file, int line);
;******************************************************************************
PUBLIC assert_failed
EXTERN Q_onAssert
assert_failed
LDR sp,=sfe(CSTACK) ; re-set the SP in case of stack overflow
BL Q_onAssert ; call the application-specific handler
B . ; should not be reached, but just in case...
END ; end of module

View File

@ -1,9 +1,11 @@
Express Logic's ThreadX for Win32
Express Logic's ThreadX for STM3240G-EVAL (Cortex-M4 FPU) Evaluation Board
Using the IAR Tools
Using the Microsoft Tools
*** DEMO VERSION ***
0. About This Version
This version of ThreadX is for demonstration purposes only and may not
@ -13,7 +15,7 @@ addition, this demonstration may not be used for any competitive purpose.
1. Installation
ThreadX for the Win32 is delivered on a single CD-ROM compatible disk.
ThreadX for the Cortex-M4 is delivered on a single CD-ROM compatible disk.
The entire distribution can be found in the sub-directory:
\threadx
@ -21,32 +23,22 @@ The entire distribution can be found in the sub-directory:
To install ThreadX to your hard-disk, either run the supplied installer
program Setup.exe or copy the distribution from the CD manually.
To copy the ThreadX distribution manually, make a threadx directory on your
hard-disk (we recommend c:\threadx\win32\microsoft) and copy all the contents
of the threadx sub-directory on the distribution disk. The following
To copy the ThreadX distribution manually, make a ThreadX directory on your
hard-disk (we recommend c:\threadx\stm3240g-eval\iar) and copy all the contents
of the ThreadX sub-directory on the distribution disk. The following
is an example MS-DOS copy command from the distribution directory
(assuming source is d: and c: is your hard-drive):
d:\threadx> xcopy /S *.* c:\threadx\win32\microsoft
d:\threadx> xcopy /S *.* c:\threadx\stm3240g-eval\iar
2. Open the ThreadX Project Workspace
2. Building the ThreadX run-time Library
In order to build the ThreadX library and the ThreadX demonstration first
load the ThreadX project workspace ThreadX_Workspace.dsw (Visual C/C++) or
ThreadX_Workspace.sln (Visual Studio), which is located inside your
ThreadX directory:
c:\threadx\win32\microsoft\ThreadX_Workspace.dsw
3. Building the ThreadX run-time Library
The demonstration version contains a pre-built ThreadX library. The library is
This demonstration version contains a pre-built ThreadX library, tx.a. The library is
intended for demonstration purposes only and thus has the following limitations:
11 Threads
10 Threads
9 Timers
2 Event Flag Groups
2 Mutexes
@ -55,145 +47,207 @@ intended for demonstration purposes only and thus has the following limitations:
1 Block Pool
1 Byte Pool
Note that performance monitoring and event tracking are also enabled by
default in this version.
Please contact Express Logic for more information or if you have any
questions regarding the demonstration or additional Express Logic products
such as NetX, FileX and USBX.
4. Building the Demonstration System
3. Demonstration System
You are now ready to run the ThreadX Win32 demonstration. Simply make the
"demo_thread" project active and then select the build button. When the build
is finished, select the run button from Visual C/C++ (or Visual Studio) and
observe various demonstration statistics being printed to the console window.
You may also set breakpoints, single step, perform data watches, etc.
The ThreadX demonstration is designed to execute under the IAR debugger on the
STM3240G-EVAL evaluation board (STM32F407 processor).
Building the demonstration is easy; simply open the threadx.www workspace file,
make the demo_threadx.ewp project the "active project" in the IAR Embedded
Workbench, and select the "Make" button.
You should observe the compilation of demo_threadx.c (which is the demonstration
application) and linking with tx.a. The resulting file demo_threadx.out is a
binary ELF file that can be downloaded to flash and executed on the STM3240G-EVAL
evaluation board connected via a USB cable to the IAR J-Link JTAG probe.
5. System Initialization
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.
The entry point in ThreadX for the Cortex-M4 using IAR tools is at label
__iar_program_start. This is defined within the IAR compiler's startup code.
In addition, this is where all static and global preset C variable
initialization processing takes place.
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.
The ThreadX tx_initialize_low_level.s file is responsible for setting up
various system data structures, and a periodic timer interrupt source.
By default, the vector area is defined at the top of startup_stm32f40x.s,
which is a slightly modified from the base ST/IAR file.
The _tx_initialize_low_level function inside of tx_initialize_low_level.s
also determines the first available address for use by the application, which
is supplied as the sole input parameter to your application definition function,
tx_application_define. To accomplish this, a section is created in
tx_initialize_low_level.s called FREE_MEM, which must be located after all
other RAM sections in memory.
6. Win32 Implementation
5. Register Usage and Stack Frames
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.
6.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.
The following defines the saved context stack frames for context switches
that occur as a result of interrupt handling or from thread-level API calls.
All suspended threads have the same stack frame in the Cortex-M4 version of
ThreadX. The top of the suspended thread's stack is pointed to by
tx_thread_stack_ptr in the associated thread control block TX_THREAD.
7. Improving Performance
Non-FPU Stack Frame:
Stack Offset Stack Contents
0x00 r4
0x04 r5
0x08 r6
0x0C r7
0x10 r8
0x14 r9
0x18 r10 (sl)
0x1C r11
0x20 r0 (Hardware stack starts here!!)
0x24 r1
0x28 r2
0x2C r3
0x30 r12
0x34 lr
0x38 pc
0x3C xPSR
FPU Stack Frame (only interrupted thread with FPU enabled):
Stack Offset Stack Contents
0x00 s0
0x04 s1
0x08 s2
0x0C s3
0x10 s4
0x14 s5
0x18 s6
0x1C s7
0x20 s8
0x24 s9
0x28 s10
0x2C s11
0x30 s12
0x34 s13
0x38 s14
0x3C s15
0x40 s16
0x44 s17
0x48 s18
0x4C s19
0x50 s20
0x54 s21
0x58 s22
0x5C s23
0x60 s24
0x64 s25
0x68 s26
0x6C s27
0x70 s28
0x74 s29
0x78 s30
0x7C s31
0x80 fpscr
0x84 r4
0x88 r5
0x8C r6
0x90 r7
0x94 r8
0x98 r9
0x9C r10 (sl)
0xA0 r11
0xA4 r0 (Hardware stack starts here!!)
0xA8 r1
0xAC r2
0xB0 r3
0xB4 r12
0xB8 lr
0xBC pc
0xC0 xPSR
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.
performance. To make it run faster, you can change the ThreadX library
project to enable various 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.
8. Interrupt Handling
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:
8.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);
ThreadX provides complete and high-performance interrupt handling for Cortex-M4
targets. There are a certain set of requirements that are defined in the
following sub-sections:
8.2 Creating a Simulated Interrupt Thread
7.1 Vector Area
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);
The Cortex-M4 vectors start at the label __tx_vectors and is defined in cstartup_M.s.
The application may modify the vector area according to its needs.
8.3 Activating the Simulated Interrupt Thread
7.2 Managed Interrupts
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);
A ThreadX managed interrupt is defined below. By following these conventions, the
application ISR is then allowed access to various ThreadX services from the ISR.
Here is the standard template for managed ISRs in ThreadX:
8.4 Simulated Interrupt Thread Template
PUBLIC __tx_IntHandler
__tx_IntHandler:
; VOID InterruptHandler (VOID)
; {
PUSH {lr}
BL _tx_thread_context_save
The following is a template for the simulated interrupt thread. This interrupt will occur on
a periodic basis.
; /* Do interrupt handler work here */
; /* .... */
DWORD WINAPI _sample_win32_interrupt(LPVOID *ptr)
{
B _tx_thread_context_restore
; }
while(1)
{
8. IAR Thread-safe Library Support
/* Sleep for the desired time. */
Sleep(18);
Thread-safe support for the IAR tools is easily enabled by building the ThreadX library
and the application with TX_ENABLE_IAR_LIBRARY_SUPPORT. Also, the linker control file
should have the following line added (if not already in place):
/* Call ThreadX context save for interrupt preparation. */
_tx_thread_context_save();
initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
/* Call application ISR here! */
/* Call ThreadX context restore for interrupt completion. */
_tx_thread_context_restore();
}
}
9. FPU Support
By default, FPU support is disabled for each thread. If saving the context of the FPU registers
is needed, the following API call must be made from the context of the application thread - before
the FPU usage:
void tx_thread_fpu_enable(void);
After this API is called in the application, FPU registers will be saved/restored for this thread if it
is preempted via an interrupt. All other suspension of the this thread will not require the FPU registers
to be saved/restored.
To disable FPU register context saving, simply call the following API:
void tx_thread_fpu_disable(void);
9. 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:
07/17/2009 Initial ThreadX version for Win32 Demo using Microsoft Visual C/C++ or Visual Studio.
01/24/2012 Initial ThreadX demo version for ST's STM3240G-EVAL board using IAR's ARM tools.
Copyright(c) 1996-2009 Express Logic, Inc.
Copyright(c) 1996-2012 Express Logic, Inc.
Express Logic, Inc.

View File

@ -1,6 +1,6 @@
/**************************************************************************/
/* */
/* Copyright (c) 1996-2009 by Express Logic Inc. */
/* Copyright (c) 1996-2011 by Express Logic Inc. */
/* */
/* This software is copyrighted by and is the sole property of Express */
/* Logic, Inc. All rights, title, ownership, or other interests */
@ -38,7 +38,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* tx_api.h PORTABLE C */
/* 5.3 */
/* 5.5 */
/* AUTHOR */
/* */
/* William E. Lamie, Express Logic, Inc. */
@ -67,12 +67,37 @@
/* changed the start of user */
/* trace events to 4096, */
/* resulting in version 5.3 */
/* 12-12-2009 William E. Lamie Modified comment(s), changed */
/* the definition of TX_NULL */
/* to a pointer type, added */
/* TX_MEMSET macro, modified */
/* priority-inheritance struct */
/* members in TX_THREAD,changed*/
/* user event comments, added */
/* callback for tracking thread*/
/* scheduling, merged event */
/* logging and MULTI run-time */
/* error checking support, */
/* changed type of all internal*/
/* structure members used for */
/* counting to UINT, and added */
/* safety critical exception */
/* logic, resulting in */
/* version 5.4 */
/* 07-15-2011 William E. Lamie Modified comment(s), added */
/* defines for major/minor */
/* version information, and */
/* removed unused original */
/* threshold mutex structure */
/* member, resulting in */
/* version 5.5 */
/* */
/**************************************************************************/
#ifndef TX_API_H
#define TX_API_H
/* Determine if a C++ compiler is being used. If so, ensure that standard
C is used to process the API information. */
@ -92,6 +117,14 @@ extern "C" {
/* Define basic constants for the ThreadX kernel. */
/* Define the major/minor version information that can be used by the application
and the ThreadX source as well. */
#define __PRODUCT_THREADX__
#define __THREADX_MAJOR_VERSION 5
#define __THREADX_MINOR_VERSION 5
/* API input parameters and general constants. */
#define TX_NO_WAIT 0
@ -112,7 +145,7 @@ extern "C" {
#define TX_NO_ACTIVATE 0
#define TX_TRUE 1
#define TX_FALSE 0
#define TX_NULL 0
#define TX_NULL (void *) 0
#define TX_LOOP_FOREVER 1
#define TX_INHERIT 1
#define TX_NO_INHERIT 0
@ -180,9 +213,26 @@ extern "C" {
#define TX_FEATURE_NOT_ENABLED 0xFF
/* Event numbers 130-4095 are reserved for ThreadX, FileX, NetX, USBX, etc. The user event numbers start at 1025, as defined below. */
/* Define the TX_MEMSET macro to the standard library function, if not already defined. */
#ifndef TX_MEMSET
#define TX_MEMSET(a,b,c) memset(a,b,c)
#endif
/* Event numbers 0 through 4095 are reserved by Express Logic. Specific event assignments are:
ThreadX events: 1-199
FileX events: 200-299
NetX events: 300-599
USBX events: 600-999
User-defined event numbers start at 4096 and continue through 65535, as defined by the constants
TX_TRACE_USER_EVENT_START and TX_TRACE_USER_EVENT_END, respectively. User events should be based
on these constants in case the user event number assignment is changed in future releases. */
#define TX_TRACE_USER_EVENT_START 4096 /* I1, I2, I3, I4 are user defined */
#define TX_TRACE_USER_EVENT_END 65535 /* I1, I2, I3, I4 are user defined */
/* Define event filters that can be used to selectively disable certain events or groups of events. */
@ -306,17 +356,22 @@ typedef struct TX_THREAD_STRUCT
is typically defined to whitespace or a pointer type in tx_port.h. */
TX_THREAD_EXTENSION_0
/* Nothing after this point is referenced by the target-specific
assembly language. Hence, information after this point can
be added to the control block providing the complete system
is recompiled. */
CHAR *tx_thread_name; /* Pointer to thread's name */
UINT tx_thread_priority; /* Priority of thread (0-1023) */
UINT tx_thread_state; /* Thread's execution state */
UINT tx_thread_delayed_suspend; /* Delayed suspend flag */
UINT tx_thread_suspending; /* Thread suspending flag */
UINT tx_thread_preempt_threshold; /* Preemption threshold */
VOID *tx_thread_stack_highest_ptr; /* Stack highest usage pointer */
/* Define the thread schedule hook. The usage of this is port/application specific,
but when used, the function pointer designated is called whenever the thread is
scheduled and unscheduled. */
VOID (*tx_thread_schedule_hook)(struct TX_THREAD_STRUCT *, ULONG);
/* Nothing after this point is referenced by the target-specific
assembly language. Hence, information after this point can
be added to the control block providing the complete system
is recompiled. */
/* Define the thread's entry point and input parameter. */
VOID (*tx_thread_entry)(ULONG);
@ -360,9 +415,10 @@ typedef struct TX_THREAD_STRUCT
/* Define the priority inheritance variables. These will be used
to manage priority inheritance changes applied to this thread
as a result of mutex get operations. */
UINT tx_thread_original_priority;
UINT tx_thread_original_preempt_threshold;
ULONG tx_thread_owned_mutex_count;
UINT tx_thread_user_priority;
UINT tx_thread_user_preempt_threshold;
UINT tx_thread_inherit_priority;
UINT tx_thread_owned_mutex_count;
struct TX_MUTEX_STRUCT
*tx_thread_owned_mutex_list;
@ -403,6 +459,10 @@ typedef struct TX_THREAD_STRUCT
ULONG tx_thread_performance_wait_abort_count;
#endif
/* Define the highest stack pointer variable. */
VOID *tx_thread_stack_highest_ptr; /* Stack highest usage pointer */
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/* Define the application callback routine used to notify the application when
@ -435,10 +495,10 @@ typedef struct TX_BLOCK_POOL_STRUCT
CHAR *tx_block_pool_name;
/* Define the number of available memory blocks in the pool. */
ULONG tx_block_pool_available;
UINT tx_block_pool_available;
/* Save the initial number of blocks. */
ULONG tx_block_pool_total;
UINT tx_block_pool_total;
/* Define the head pointer of the available block pool. */
UCHAR *tx_block_pool_available_list;
@ -450,13 +510,13 @@ typedef struct TX_BLOCK_POOL_STRUCT
ULONG tx_block_pool_size;
/* Save the individual memory block size - rounded for alignment. */
ULONG tx_block_pool_block_size;
UINT tx_block_pool_block_size;
/* Define the block pool suspension list head along with a count of
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_block_pool_suspension_list;
ULONG tx_block_pool_suspended_count;
UINT tx_block_pool_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_BLOCK_POOL_STRUCT
@ -500,7 +560,7 @@ typedef struct TX_BYTE_POOL_STRUCT
ULONG tx_byte_pool_available;
/* Define the number of fragments in the pool. */
ULONG tx_byte_pool_fragments;
UINT tx_byte_pool_fragments;
/* Define the head pointer of byte pool. */
UCHAR *tx_byte_pool_list;
@ -525,7 +585,7 @@ typedef struct TX_BYTE_POOL_STRUCT
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_byte_pool_suspension_list;
ULONG tx_byte_pool_suspended_count;
UINT tx_byte_pool_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_BYTE_POOL_STRUCT
@ -587,7 +647,7 @@ typedef struct TX_EVENT_FLAGS_GROUP_STRUCT
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_event_flags_group_suspension_list;
ULONG tx_event_flags_group_suspended_count;
UINT tx_event_flags_group_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_EVENT_FLAGS_GROUP_STRUCT
@ -638,7 +698,7 @@ typedef struct TX_MUTEX_STRUCT
CHAR *tx_mutex_name;
/* Define the mutex ownership count. */
ULONG tx_mutex_ownership_count;
UINT tx_mutex_ownership_count;
/* Define the mutex ownership pointer. This pointer points to the
the thread that owns the mutex. */
@ -648,16 +708,14 @@ typedef struct TX_MUTEX_STRUCT
inheritance will be in effect. */
UINT tx_mutex_inherit;
/* Define the save area for the owning thread's original priority and
threshold. */
/* Define the save area for the owning thread's original priority. */
UINT tx_mutex_original_priority;
UINT tx_mutex_original_threshold;
/* Define the mutex suspension list head along with a count of
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_mutex_suspension_list;
ULONG tx_mutex_suspended_count;
UINT tx_mutex_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_MUTEX_STRUCT
@ -666,7 +724,7 @@ typedef struct TX_MUTEX_STRUCT
/* Define the priority of the highest priority thread waiting for
this mutex. */
ULONG tx_mutex_highest_priority_waiting;
UINT tx_mutex_highest_priority_waiting;
/* Define the owned list next and previous pointers. */
struct TX_MUTEX_STRUCT
@ -716,12 +774,12 @@ typedef struct TX_QUEUE_STRUCT
UINT tx_queue_message_size;
/* Define the total number of messages in the queue. */
ULONG tx_queue_capacity;
UINT tx_queue_capacity;
/* Define the current number of messages enqueue and the available
/* Define the current number of messages enqueued and the available
queue storage space. */
ULONG tx_queue_enqueued;
ULONG tx_queue_available_storage;
UINT tx_queue_enqueued;
UINT tx_queue_available_storage;
/* Define pointers that represent the start and end for the queue's
message area. */
@ -737,7 +795,7 @@ typedef struct TX_QUEUE_STRUCT
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_queue_suspension_list;
ULONG tx_queue_suspended_count;
UINT tx_queue_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_QUEUE_STRUCT
@ -799,7 +857,7 @@ typedef struct TX_SEMAPHORE_STRUCT
how many threads are suspended. */
struct TX_THREAD_STRUCT
*tx_semaphore_suspension_list;
ULONG tx_semaphore_suspended_count;
UINT tx_semaphore_suspended_count;
/* Define the created list next and previous pointers. */
struct TX_SEMAPHORE_STRUCT
@ -882,12 +940,17 @@ typedef struct TX_SEMAPHORE_STRUCT
#define tx_event_flags_set _tx_event_flags_set
#define tx_event_flags_set_notify _tx_event_flags_set_notify
#ifdef TX_ENABLE_EVENT_LOGGING
UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_el_interrupt_control
#else
#ifdef TX_ENABLE_EVENT_TRACE
UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_trace_interrupt_control
#else
#define tx_interrupt_control _tx_thread_interrupt_control
#endif
#endif
#define tx_mutex_create _tx_mutex_create
#define tx_mutex_delete _tx_mutex_delete
@ -966,6 +1029,126 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_kernel_enter _tx_initialize_kernel_enter
/* Define the system API mappings depending on the runtime error
checking behavior selected by the user. */
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
/* Services with MULTI runtime error checking ThreadX. */
#define tx_block_allocate _txr_block_allocate
#define tx_block_pool_create(p,n,b,s,l) _txr_block_pool_create(p,n,b,s,l,sizeof(TX_BLOCK_POOL))
#define tx_block_pool_delete _txr_block_pool_delete
#define tx_block_pool_info_get _txr_block_pool_info_get
#define tx_block_pool_performance_info_get _tx_block_pool_performance_info_get
#define tx_block_pool_performance_system_info_get _tx_block_pool_performance_system_info_get
#define tx_block_pool_prioritize _txr_block_pool_prioritize
#define tx_block_release _txr_block_release
#define tx_byte_allocate _txr_byte_allocate
#define tx_byte_pool_create(p,n,s,l) _txr_byte_pool_create(p,n,s,l,sizeof(TX_BYTE_POOL))
#define tx_byte_pool_delete _txr_byte_pool_delete
#define tx_byte_pool_info_get _txr_byte_pool_info_get
#define tx_byte_pool_performance_info_get _tx_byte_pool_performance_info_get
#define tx_byte_pool_performance_system_info_get _tx_byte_pool_performance_system_info_get
#define tx_byte_pool_prioritize _txr_byte_pool_prioritize
#define tx_byte_release _txr_byte_release
#define tx_event_flags_create(g,n) _txr_event_flags_create(g,n,sizeof(TX_EVENT_FLAGS_GROUP))
#define tx_event_flags_delete _txr_event_flags_delete
#define tx_event_flags_get _txr_event_flags_get
#define tx_event_flags_info_get _txr_event_flags_info_get
#define tx_event_flags_performance_info_get _tx_event_flags_performance_info_get
#define tx_event_flags_performance_system_info_get _tx_event_flags_performance_system_info_get
#define tx_event_flags_set _txr_event_flags_set
#define tx_event_flags_set_notify _txr_event_flags_set_notify
#ifdef TX_ENABLE_EVENT_LOGGING
UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_el_interrupt_control
#else
#ifdef TX_ENABLE_EVENT_TRACE
UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_trace_interrupt_control
#else
#define tx_interrupt_control _tx_thread_interrupt_control
#endif
#endif
#define tx_mutex_create(m,n,i) _txr_mutex_create(m,n,i,sizeof(TX_MUTEX))
#define tx_mutex_delete _txr_mutex_delete
#define tx_mutex_get _txr_mutex_get
#define tx_mutex_info_get _txr_mutex_info_get
#define tx_mutex_performance_info_get _tx_mutex_performance_info_get
#define tx_mutex_performance_system_info_get _tx_mutex_performance_system_info_get
#define tx_mutex_prioritize _txr_mutex_prioritize
#define tx_mutex_put _txr_mutex_put
#define tx_queue_create(q,n,m,s,l) _txr_queue_create(q,n,m,s,l,sizeof(TX_QUEUE))
#define tx_queue_delete _txr_queue_delete
#define tx_queue_flush _txr_queue_flush
#define tx_queue_info_get _txr_queue_info_get
#define tx_queue_performance_info_get _tx_queue_performance_info_get
#define tx_queue_performance_system_info_get _tx_queue_performance_system_info_get
#define tx_queue_receive _txr_queue_receive
#define tx_queue_send _txr_queue_send
#define tx_queue_send_notify _txr_queue_send_notify
#define tx_queue_front_send _txr_queue_front_send
#define tx_queue_prioritize _txr_queue_prioritize
#define tx_semaphore_ceiling_put _txr_semaphore_ceiling_put
#define tx_semaphore_create(s,n,i) _txr_semaphore_create(s,n,i,sizeof(TX_SEMAPHORE))
#define tx_semaphore_delete _txr_semaphore_delete
#define tx_semaphore_get _txr_semaphore_get
#define tx_semaphore_info_get _txr_semaphore_info_get
#define tx_semaphore_performance_info_get _tx_semaphore_performance_info_get
#define tx_semaphore_performance_system_info_get _tx_semaphore_performance_system_info_get
#define tx_semaphore_prioritize _txr_semaphore_prioritize
#define tx_semaphore_put _txr_semaphore_put
#define tx_semaphore_put_notify _txr_semaphore_put_notify
#define tx_thread_create(t,n,e,i,s,l,p,r,c,a) _txr_thread_create(t,n,e,i,s,l,p,r,c,a,sizeof(TX_THREAD))
#define tx_thread_delete _txr_thread_delete
#define tx_thread_entry_exit_notify _txr_thread_entry_exit_notify
#define tx_thread_identify _tx_thread_identify
#define tx_thread_info_get _txr_thread_info_get
#define tx_thread_performance_info_get _tx_thread_performance_info_get
#define tx_thread_performance_system_info_get _tx_thread_performance_system_info_get
#define tx_thread_preemption_change _txr_thread_preemption_change
#define tx_thread_priority_change _txr_thread_priority_change
#define tx_thread_relinquish _txe_thread_relinquish
#define tx_thread_reset _txr_thread_reset
#define tx_thread_resume _txr_thread_resume
#define tx_thread_sleep _tx_thread_sleep
#define tx_thread_stack_error_notify _tx_thread_stack_error_notify
#define tx_thread_suspend _txr_thread_suspend
#define tx_thread_terminate _txr_thread_terminate
#define tx_thread_time_slice_change _txr_thread_time_slice_change
#define tx_thread_wait_abort _txr_thread_wait_abort
#define tx_time_get _tx_time_get
#define tx_time_set _tx_time_set
#define tx_timer_activate _txr_timer_activate
#define tx_timer_change _txr_timer_change
#define tx_timer_create(t,n,e,i,c,r,a) _txr_timer_create(t,n,e,i,c,r,a,sizeof(TX_TIMER))
#define tx_timer_deactivate _txr_timer_deactivate
#define tx_timer_delete _txr_timer_delete
#define tx_timer_info_get _txr_timer_info_get
#define tx_timer_performance_info_get _tx_timer_performance_info_get
#define tx_timer_performance_system_info_get _tx_timer_performance_system_info_get
#define tx_trace_enable _tx_trace_enable
#define tx_trace_event_filter _tx_trace_event_filter
#define tx_trace_event_unfilter _tx_trace_event_unfilter
#define tx_trace_disable _tx_trace_disable
#define tx_trace_isr_enter_insert _tx_trace_isr_enter_insert
#define tx_trace_isr_exit_insert _tx_trace_isr_exit_insert
#define tx_trace_buffer_full_notify _tx_trace_buffer_full_notify
#define tx_trace_user_event_insert _tx_trace_user_event_insert
#else
#define tx_block_allocate _txe_block_allocate
#define tx_block_pool_create(p,n,b,s,l) _txe_block_pool_create(p,n,b,s,l,sizeof(TX_BLOCK_POOL))
#define tx_block_pool_delete _txe_block_pool_delete
@ -993,12 +1176,17 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_event_flags_set _txe_event_flags_set
#define tx_event_flags_set_notify _txe_event_flags_set_notify
#ifdef TX_ENABLE_EVENT_LOGGING
UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_el_interrupt_control
#else
#ifdef TX_ENABLE_EVENT_TRACE
UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_interrupt_control _tx_trace_interrupt_control
#else
#define tx_interrupt_control _tx_thread_interrupt_control
#endif
#endif
#define tx_mutex_create(m,n,i) _txe_mutex_create(m,n,i,sizeof(TX_MUTEX))
#define tx_mutex_delete _txe_mutex_delete
@ -1072,6 +1260,7 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_trace_user_event_insert _tx_trace_user_event_insert
#endif
#endif
/* Declare the tx_application_define function as having C linkage. */
@ -1091,9 +1280,14 @@ UINT tx_block_allocate(TX_BLOCK_POOL *pool_ptr, VOID **block_ptr, ULONG w
UINT _tx_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
VOID *pool_start, ULONG pool_size);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
VOID *pool_start, ULONG pool_size, UINT pool_control_block_size);
#else
UINT _txe_block_pool_create(TX_BLOCK_POOL *pool_ptr, CHAR *name_ptr, ULONG block_size,
VOID *pool_start, ULONG pool_size, UINT pool_control_block_size);
#endif
#endif
UINT tx_block_pool_delete(TX_BLOCK_POOL *pool_ptr);
UINT tx_block_pool_info_get(TX_BLOCK_POOL *pool_ptr, CHAR **name, ULONG *available_blocks,
ULONG *total_blocks, TX_THREAD **first_suspended,
@ -1111,9 +1305,14 @@ UINT tx_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG me
UINT _tx_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
ULONG pool_size);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
ULONG pool_size, UINT pool_control_block_size);
#else
UINT _txe_byte_pool_create(TX_BYTE_POOL *pool_ptr, CHAR *name_ptr, VOID *pool_start,
ULONG pool_size, UINT pool_control_block_size);
#endif
#endif
UINT tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr);
UINT tx_byte_pool_info_get(TX_BYTE_POOL *pool_ptr, CHAR **name, ULONG *available_bytes,
ULONG *fragments, TX_THREAD **first_suspended,
@ -1128,8 +1327,12 @@ UINT tx_byte_release(VOID *memory_ptr);
#ifdef TX_DISABLE_ERROR_CHECKING
UINT _tx_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr, UINT event_control_block_size);
#else
UINT _txe_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name_ptr, UINT event_control_block_size);
#endif
#endif
UINT tx_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr);
UINT tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
@ -1149,8 +1352,12 @@ UINT tx_interrupt_control(UINT new_posture);
#ifdef TX_DISABLE_ERROR_CHECKING
UINT _tx_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit, UINT mutex_control_block_size);
#else
UINT _txe_mutex_create(TX_MUTEX *mutex_ptr, CHAR *name_ptr, UINT inherit, UINT mutex_control_block_size);
#endif
#endif
UINT tx_mutex_delete(TX_MUTEX *mutex_ptr);
UINT tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option);
UINT tx_mutex_info_get(TX_MUTEX *mutex_ptr, CHAR **name, ULONG *count, TX_THREAD **owner,
@ -1167,9 +1374,14 @@ UINT tx_mutex_put(TX_MUTEX *mutex_ptr);
UINT _tx_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
VOID *queue_start, ULONG queue_size);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
VOID *queue_start, ULONG queue_size, UINT queue_control_block_size);
#else
UINT _txe_queue_create(TX_QUEUE *queue_ptr, CHAR *name_ptr, UINT message_size,
VOID *queue_start, ULONG queue_size, UINT queue_control_block_size);
#endif
#endif
UINT tx_queue_delete(TX_QUEUE *queue_ptr);
UINT tx_queue_flush(TX_QUEUE *queue_ptr);
UINT tx_queue_info_get(TX_QUEUE *queue_ptr, CHAR **name, ULONG *enqueued, ULONG *available_storage,
@ -1188,8 +1400,12 @@ UINT tx_semaphore_ceiling_put(TX_SEMAPHORE *semaphore_ptr, ULONG ceiling)
#ifdef TX_DISABLE_ERROR_CHECKING
UINT _tx_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count, UINT semaphore_control_block_size);
#else
UINT _txe_semaphore_create(TX_SEMAPHORE *semaphore_ptr, CHAR *name_ptr, ULONG initial_count, UINT semaphore_control_block_size);
#endif
#endif
UINT tx_semaphore_delete(TX_SEMAPHORE *semaphore_ptr);
UINT tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option);
UINT tx_semaphore_info_get(TX_SEMAPHORE *semaphore_ptr, CHAR **name, ULONG *current_value,
@ -1210,12 +1426,20 @@ UINT _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
VOID (*entry_function)(ULONG), ULONG entry_input,
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
#else
UINT _txe_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
VOID (*entry_function)(ULONG), ULONG entry_input,
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
#endif
#endif
UINT tx_thread_delete(TX_THREAD *thread_ptr);
UINT tx_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *, UINT));
TX_THREAD *tx_thread_identify(VOID);
@ -1253,10 +1477,16 @@ UINT _tx_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
VOID (*expiration_function)(ULONG), ULONG expiration_input, ULONG initial_ticks,
ULONG reschedule_ticks, UINT auto_activate);
#else
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
UINT _txr_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
VOID (*expiration_function)(ULONG), ULONG expiration_input, ULONG initial_ticks,
ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
#else
UINT _txe_timer_create(TX_TIMER *timer_ptr, CHAR *name_ptr,
VOID (*expiration_function)(ULONG), ULONG expiration_input, ULONG initial_ticks,
ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
#endif
#endif
UINT tx_timer_deactivate(TX_TIMER *timer_ptr);
UINT tx_timer_delete(TX_TIMER *timer_ptr);
UINT tx_timer_info_get(TX_TIMER *timer_ptr, CHAR **name, UINT *active, ULONG *remaining_ticks,
@ -1278,6 +1508,249 @@ UINT tx_trace_user_event_insert(ULONG event_id, ULONG info_field_1, ULONG
#endif
/* Define safety critical configuration and exception handling. */
#ifdef TX_SAFETY_CRITICAL
/* Ensure the maximum number of priorities is defined in safety critical mode. */
#ifndef TX_MAX_PRIORITIES
#error "tx_port.h: TX_MAX_PRIORITIES not defined."
#endif
/* Ensure the maximum number of priorities is a multiple of 32. */
#if (TX_MAX_PRIORITIES %32) != 0
#error "tx_port.h: TX_MAX_PRIORITIES must be a multiple of 32."
#endif
/* Ensure error checking is enabled. */
#ifdef TX_DISABLE_ERROR_CHECKING
#error "TX_DISABLE_ERROR_CHECKING must not be defined."
#endif
/* Ensure timer ISR processing is not defined. */
#ifdef TX_TIMER_PROCESS_IN_ISR
#error "TX_TIMER_PROCESS_IN_ISR must not be defined."
#endif
/* Ensure timer reactivation in-line is not defined. */
#ifdef TX_REACTIVATE_INLINE
#error "TX_REACTIVATE_INLINE must not be defined."
#endif
/* Ensure disable stack filling is not defined. */
#ifdef TX_DISABLE_STACK_FILLING
#error "TX_DISABLE_STACK_FILLING must not be defined."
#endif
/* Ensure enable stack checking is not defined. */
#ifdef TX_ENABLE_STACK_CHECKING
#error "TX_ENABLE_STACK_CHECKING must not be defined."
#endif
/* Ensure disable preemption-threshold is not defined. */
#ifdef TX_DISABLE_PREEMPTION_THRESHOLD
#error "TX_DISABLE_PREEMPTION_THRESHOLD must not be defined."
#endif
/* Ensure disable redundant clearing is not defined. */
#ifdef TX_DISABLE_REDUNDANT_CLEARING
#error "TX_DISABLE_REDUNDANT_CLEARING must not be defined."
#endif
/* Ensure no timer is not defined. */
#ifdef TX_NO_TIMER
#error "TX_NO_TIMER must not be defined."
#endif
/* Ensure disable notify callbacks is not defined. */
#ifdef TX_DISABLE_NOTIFY_CALLBACKS
#error "TX_DISABLE_NOTIFY_CALLBACKS must not be defined."
#endif
/* Ensure inline thread suspend/resume is not defined. */
#ifdef TX_INLINE_THREAD_RESUME_SUSPEND
#error "TX_INLINE_THREAD_RESUME_SUSPEND must not be defined."
#endif
/* Ensure not interruptable is not defined. */
#ifdef TX_NOT_INTERRUPTABLE
#error "TX_NOT_INTERRUPTABLE must not be defined."
#endif
/* Ensure event trace enable is not defined. */
#ifdef TX_ENABLE_EVENT_TRACE
#error "TX_ENABLE_EVENT_TRACE must not be defined."
#endif
/* Ensure block pool performance info enable is not defined. */
#ifdef TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
#error "TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure byte pool performance info enable is not defined. */
#ifdef TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
#error "TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure event flag performance info enable is not defined. */
#ifdef TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
#error "TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure mutex performance info enable is not defined. */
#ifdef TX_MUTEX_ENABLE_PERFORMANCE_INFO
#error "TX_MUTEX_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure queue performance info enable is not defined. */
#ifdef TX_QUEUE_ENABLE_PERFORMANCE_INFO
#error "TX_QUEUE_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure semaphore performance info enable is not defined. */
#ifdef TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
#error "TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure thread performance info enable is not defined. */
#ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO
#error "TX_THREAD_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Ensure timer performance info enable is not defined. */
#ifdef TX_TIMER_ENABLE_PERFORMANCE_INFO
#error "TX_TIMER_ENABLE_PERFORMANCE_INFO must not be defined."
#endif
/* Now define the safety critical exception handler. */
VOID _tx_safety_critical_exception_handler(CHAR *file_name, INT line_number, UINT status);
#ifndef TX_SAFETY_CRITICAL_EXCEPTION
#define TX_SAFETY_CRITICAL_EXCEPTION(a, b, c) _tx_safety_critical_exception_handler(a, b, c);
#endif
#ifndef TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
#define TX_SAFETY_CRITICAL_EXCEPTION_HANDLER VOID _tx_safety_critical_exception_handler(CHAR *file_name, INT line_number, UINT status) \
{ \
while(1) \
{ \
} \
}
#endif
#endif
#ifdef TX_ENABLE_MULTI_ERROR_CHECKING
/* Define ThreadX API MULTI run-time error checking function. */
void __ghs_rnerr(char *errMsg, int stackLevels, int stackTraceDisplay, void *hexVal);
#endif
/* Bring in the event logging constants and prototypes. Note that
TX_ENABLE_EVENT_LOGGING must be defined when building the ThreadX
library components in order to enable event logging. */
#ifdef TX_ENABLE_EVENT_LOGGING
#include "tx_el.h"
#else
#ifndef TX_SOURCE_CODE
#define _tx_el_user_event_insert(a,b,c,d,e)
#endif
#define TX_EL_INITIALIZE
#define TX_EL_THREAD_REGISTER(a)
#define TX_EL_THREAD_UNREGISTER(a)
#define TX_EL_THREAD_STATUS_CHANGE_INSERT(a, b)
#define TX_EL_BYTE_ALLOCATE_INSERT
#define TX_EL_BYTE_POOL_CREATE_INSERT
#define TX_EL_BYTE_POOL_DELETE_INSERT
#define TX_EL_BYTE_RELEASE_INSERT
#define TX_EL_BLOCK_ALLOCATE_INSERT
#define TX_EL_BLOCK_POOL_CREATE_INSERT
#define TX_EL_BLOCK_POOL_DELETE_INSERT
#define TX_EL_BLOCK_RELEASE_INSERT
#define TX_EL_EVENT_FLAGS_CREATE_INSERT
#define TX_EL_EVENT_FLAGS_DELETE_INSERT
#define TX_EL_EVENT_FLAGS_GET_INSERT
#define TX_EL_EVENT_FLAGS_SET_INSERT
#define TX_EL_INTERRUPT_CONTROL_INSERT
#define TX_EL_QUEUE_CREATE_INSERT
#define TX_EL_QUEUE_DELETE_INSERT
#define TX_EL_QUEUE_FLUSH_INSERT
#define TX_EL_QUEUE_RECEIVE_INSERT
#define TX_EL_QUEUE_SEND_INSERT
#define TX_EL_SEMAPHORE_CREATE_INSERT
#define TX_EL_SEMAPHORE_DELETE_INSERT
#define TX_EL_SEMAPHORE_GET_INSERT
#define TX_EL_SEMAPHORE_PUT_INSERT
#define TX_EL_THREAD_CREATE_INSERT
#define TX_EL_THREAD_DELETE_INSERT
#define TX_EL_THREAD_IDENTIFY_INSERT
#define TX_EL_THREAD_PREEMPTION_CHANGE_INSERT
#define TX_EL_THREAD_PRIORITY_CHANGE_INSERT
#define TX_EL_THREAD_RELINQUISH_INSERT
#define TX_EL_THREAD_RESUME_INSERT
#define TX_EL_THREAD_SLEEP_INSERT
#define TX_EL_THREAD_SUSPEND_INSERT
#define TX_EL_THREAD_TERMINATE_INSERT
#define TX_EL_THREAD_TIME_SLICE_CHANGE_INSERT
#define TX_EL_TIME_GET_INSERT
#define TX_EL_TIME_SET_INSERT
#define TX_EL_TIMER_ACTIVATE_INSERT
#define TX_EL_TIMER_CHANGE_INSERT
#define TX_EL_TIMER_CREATE_INSERT
#define TX_EL_TIMER_DEACTIVATE_INSERT
#define TX_EL_TIMER_DELETE_INSERT
#define TX_EL_BLOCK_POOL_INFO_GET_INSERT
#define TX_EL_BLOCK_POOL_PRIORITIZE_INSERT
#define TX_EL_BYTE_POOL_INFO_GET_INSERT
#define TX_EL_BYTE_POOL_PRIORITIZE_INSERT
#define TX_EL_EVENT_FLAGS_INFO_GET_INSERT
#define TX_EL_MUTEX_CREATE_INSERT
#define TX_EL_MUTEX_DELETE_INSERT
#define TX_EL_MUTEX_GET_INSERT
#define TX_EL_MUTEX_INFO_GET_INSERT
#define TX_EL_MUTEX_PRIORITIZE_INSERT
#define TX_EL_MUTEX_PUT_INSERT
#define TX_EL_QUEUE_INFO_GET_INSERT
#define TX_EL_QUEUE_FRONT_SEND_INSERT
#define TX_EL_QUEUE_PRIORITIZE_INSERT
#define TX_EL_SEMAPHORE_INFO_GET_INSERT
#define TX_EL_SEMAPHORE_PRIORITIZE_INSERT
#define TX_EL_THREAD_INFO_GET_INSERT
#define TX_EL_THREAD_WAIT_ABORT_INSERT
#define TX_EL_TIMER_INFO_GET_INSERT
#define TX_EL_BLOCK_POOL_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_BLOCK_POOL_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_BYTE_POOL_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_BYTE_POOL_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_EVENT_FLAGS_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_EVENT_FLAGS_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_EVENT_FLAGS_SET_NOTIFY_INSERT
#define TX_EL_MUTEX_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_MUTEX_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_QUEUE_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_QUEUE_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_QUEUE_SEND_NOTIFY_INSERT
#define TX_EL_SEMAPHORE_CEILING_PUT_INSERT
#define TX_EL_SEMAPHORE_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_SEMAPHORE_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_SEMAPHORE_PUT_NOTIFY_INSERT
#define TX_EL_THREAD_ENTRY_EXIT_NOTIFY_INSERT
#define TX_EL_THREAD_RESET_INSERT
#define TX_EL_THREAD_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_THREAD_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#define TX_EL_THREAD_STACK_ERROR_NOTIFY_INSERT
#define TX_EL_TIMER_PERFORMANCE_INFO_GET_INSERT
#define TX_EL_TIMER_PERFORMANCE_SYSTEM_INFO_GET_INSERT
#endif
/* Determine if a C++ compiler is being used. If so, complete the standard
C conditional started above. */
#ifdef __cplusplus

View File

@ -0,0 +1,227 @@
;/**************************************************************************/
;/* */
;/* Copyright (c) 1996-2011 by Express Logic Inc. */
;/* */
;/* This software is copyrighted by and is the sole property of Express */
;/* Logic, Inc. All rights, title, ownership, or other interests */
;/* in the software remain the property of Express Logic, Inc. This */
;/* software may only be used in accordance with the corresponding */
;/* license agreement. Any unauthorized use, duplication, transmission, */
;/* distribution, or disclosure of this software is expressly forbidden. */
;/* */
;/* This Copyright notice may not be removed or modified without prior */
;/* written consent of Express Logic, Inc. */
;/* */
;/* Express Logic, Inc. reserves the right to modify this software */
;/* without notice. */
;/* */
;/* Express Logic, Inc. info@expresslogic.com */
;/* 11423 West Bernardo Court http://www.expresslogic.com */
;/* San Diego, CA 92127 */
;/* */
;/**************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
;/** */
;/** ThreadX Component */
;/** */
;/** Initialize */
;/** */
;/**************************************************************************/
;/**************************************************************************/
;
;#define TX_SOURCE_CODE
;
;
;/* Include necessary system files. */
;
;#include "tx_api.h"
;#include "tx_initialize.h"
;#include "tx_thread.h"
;#include "tx_timer.h"
;
;
EXTERN _tx_thread_system_stack_ptr
EXTERN _tx_initialize_unused_memory
EXTERN _tx_thread_context_save
EXTERN _tx_thread_context_restore
EXTERN _tx_timer_interrupt
EXTERN __iar_program_start
EXTERN __tx_SVCallHandler
EXTERN __tx_PendSVHandler
EXTERN __tx_vectors
EXTERN __iar_program_start
;
;
SYSTEM_CLOCK EQU 150000000
SYSTICK_CYCLES EQU ((SYSTEM_CLOCK / 100) -1)
RSEG FREE_MEM:DATA
PUBLIC __tx_free_memory_start
__tx_free_memory_start
DS32 4
;
;
SECTION `.text`:CODE:NOROOT(2)
THUMB
;/**************************************************************************/
;/* */
;/* FUNCTION RELEASE */
;/* */
;/* _tx_initialize_low_level Cortex-M4/IAR */
;/* 5.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Express Logic, Inc. */
;/* */
;/* 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 */
;/* */
;/* None */
;/* */
;/* CALLED BY */
;/* */
;/* _tx_initialize_kernel_enter ThreadX entry function */
;/* */
;/* RELEASE HISTORY */
;/* */
;/* DATE NAME DESCRIPTION */
;/* */
;/* 10-10-2010 William E. Lamie Initial Version 5.0 */
;/* 07-15-2011 William E. Lamie Modified comment(s), */
;/* resulting in version 5.1 */
;/* */
;/**************************************************************************/
;VOID _tx_initialize_low_level(VOID)
;{
PUBLIC _tx_initialize_low_level
_tx_initialize_low_level:
;
; /* Ensure that interrupts are disabled. */
;
CPSID i ; Disable interrupts
;
;
; /* Set base of available memory to end of non-initialised RAM area. */
;
LDR r0, =__tx_free_memory_start ; Get end of non-initialized RAM area
LDR r2, =_tx_initialize_unused_memory ; Build address of unused memory pointer
STR r0, [r2, #0] ; Save first free memory address
;
; /* Enable the cycle count register. */
;
LDR r0, =0xE0001000 ; Build address of DWT register
LDR r1, [r0] ; Pickup the current value
ORR r1, r1, #1 ; Set the CYCCNTENA bit
STR r1, [r0] ; Enable the cycle count register
;
; /* Setup Vector Table Offset Register. */
;
MOV r0, #0xE000E000 ; Build address of NVIC registers
LDR r1, =__tx_vectors ; Pickup address of vector table
STR r1, [r0, #0xD08] ; Set vector table address
;
; /* Set system stack pointer from vector value. */
;
LDR r0, =_tx_thread_system_stack_ptr ; Build address of system stack pointer
LDR r1, =__tx_vectors ; Pickup address of vector table
LDR r1, [r1] ; Pickup reset stack pointer
STR r1, [r0] ; Save system stack pointer
;
; /* Configure SysTick for 100Hz clock, or 16384 cycles if no reference. */
;
MOV r0, #0xE000E000 ; Build address of NVIC registers
LDR r1, =SYSTICK_CYCLES
STR r1, [r0, #0x14] ; Setup SysTick Reload Value
MOV r1, #0x7 ; Build SysTick Control Enable Value
STR r1, [r0, #0x10] ; Setup SysTick Control
;
; /* Configure handler priorities. */
;
LDR r1, =0x00000000 ; Rsrv, UsgF, BusF, MemM
STR r1, [r0, #0xD18] ; Setup System Handlers 4-7 Priority Registers
LDR r1, =0xFF000000 ; SVCl, Rsrv, Rsrv, Rsrv
STR r1, [r0, #0xD1C] ; Setup System Handlers 8-11 Priority Registers
; Note: SVC must be lowest priority, which is 0xFF
LDR r1, =0x40FF0000 ; SysT, PnSV, Rsrv, DbgM
STR r1, [r0, #0xD20] ; Setup System Handlers 12-15 Priority Registers
; Note: PnSV must be lowest priority, which is 0xFF
LDR r0, =0xE000EF34 ; Pickup FPCCR
LDR r1, [r0] ;
LDR r2, =0x3FFFFFFF ; Build mask to clear ASPEN and LSPEN
AND r1, r1, r2 ; Clear the ASPEN and LSPEN bits
STR r1, [r0] ; Update FPCCR
;
; /* Return to caller. */
;
BX lr
;}
;
;
PUBLIC __stack_test
__stack_test:
push {r0}
push {r1}
push {r2}
push {r3}
pop {r3}
pop {r2}
pop {r1}
pop {r0}
bx lr
;/* Define shells for each of the unused vectors. */
;
PUBLIC __tx_IntHandler
__tx_IntHandler:
; VOID InterruptHandler (VOID)
; {
PUSH {lr}
BL _tx_thread_context_save
; /* Do interrupt handler work here */
; /* .... */
B _tx_thread_context_restore
; }
PUBLIC __tx_SysTickHandler
__tx_SysTickHandler:
; VOID TimerInterruptHandler (VOID)
; {
;
PUSH {lr}
BL _tx_thread_context_save
MOV r0, #0xE000E000 ; Build address of NVIC registers
LDR r1, [r0, #0x10] ; Clear SysTick interrupt
BL _tx_timer_interrupt
B _tx_thread_context_restore
; }
END

View File

@ -1,6 +1,6 @@
/**************************************************************************/
/* */
/* Copyright (c) 1996-2008 by Express Logic Inc. */
/* Copyright (c) 1996-2011 by Express Logic Inc. */
/* */
/* This software is copyrighted by and is the sole property of Express */
/* Logic, Inc. All rights, title, ownership, or other interests */
@ -37,7 +37,7 @@
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* tx_port.h Win32/Visual */
/* tx_port.h Cortex-M4/IAR */
/* 5.1 */
/* */
/* AUTHOR */
@ -59,34 +59,32 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 12-12-2005 William E. Lamie Initial Win32/Visual C/C++ */
/* 10-10-2010 William E. Lamie Initial Cortex-M4 IAR */
/* Support Version 5.0 */
/* 12-12-2008 William E. Lamie Modified comment(s), added */
/* trace support, changed */
/* interrupt disable/restore */
/* macros to use interrupt */
/* control function, added */
/* macros for Win32-specific */
/* initialization, increased */
/* default memory size, and */
/* updated release string, */
/* resulting in version 5.1 */
/* 07-15-2011 William E. Lamie Modified comment(s), added */
/* IAR thread-safe library */
/* support, and updated */
/* version string, resulting */
/* in version 5.1 */
/* */
/**************************************************************************/
#ifndef TX_PORT_H
#define TX_PORT_H
#ifndef TX_ENABLE_EVENT_TRACE
#define TX_ENABLE_EVENT_TRACE
#endif
/* Define default parameters for the Cortex-M4 build for smaller footprint. */
#define TX_TIMER_PROCESS_IN_ISR
#define TX_DISABLE_PREEMPTION_THRESHOLD
#define TX_DISABLE_NOTIFY_CALLBACKS
#define TX_DISABLE_ERROR_CHECKING
/* 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. */
@ -98,6 +96,10 @@
#include <stdlib.h>
#include <string.h>
#include <intrinsics.h>
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
#include <yvals.h>
#endif
/* Define ThreadX basic types for this port. */
@ -113,11 +115,6 @@ typedef short SHORT;
typedef unsigned short USHORT;
/* 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. */
@ -138,7 +135,7 @@ typedef unsigned short USHORT;
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! */
#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */
#endif
#ifndef TX_TIMER_THREAD_PRIORITY
@ -146,7 +143,7 @@ typedef unsigned short USHORT;
#endif
/* Define various constants for the ThreadX port. */
/* Define various constants for the ThreadX Cortex-M3 port. */
#define TX_INT_DISABLE 1 /* Disable interrupts */
#define TX_INT_ENABLE 0 /* Enable interrupts */
@ -162,18 +159,13 @@ typedef unsigned short USHORT;
*/
#ifndef TX_TRACE_TIME_SOURCE
#define TX_TRACE_TIME_SOURCE ((ULONG) (_tx_win32_time_stamp.LowPart));
#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004)
#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. */
@ -187,13 +179,6 @@ typedef unsigned short USHORT;
#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
@ -209,14 +194,14 @@ void _tx_initialize_start_interrupts(void);
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_0
#define TX_THREAD_EXTENSION_1
#define TX_THREAD_EXTENSION_2
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
#define TX_THREAD_EXTENSION_3 VOID *tx_thread_iar_tls_pointer;
#else
#define TX_THREAD_EXTENSION_3
#endif
/* Define the port extensions of the remaining ThreadX objects. */
@ -242,8 +227,15 @@ void _tx_initialize_start_interrupts(void);
tx_thread_shell_entry, and tx_thread_terminate. */
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
#define TX_THREAD_CREATE_EXTENSION(thread_ptr) thread_ptr -> tx_thread_iar_tls_pointer = __iar_dlib_perthread_allocate();
#define TX_THREAD_DELETE_EXTENSION(thread_ptr) __iar_dlib_perthread_deallocate(thread_ptr -> tx_thread_iar_tls_pointer); \
thread_ptr -> tx_thread_iar_tls_pointer = TX_NULL;
#define TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION __iar_dlib_perthread_access(0);
#else
#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
#endif
#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr)
@ -270,6 +262,15 @@ void _tx_initialize_start_interrupts(void);
#define TX_TIMER_DELETE_EXTENSION(timer_ptr)
/* Determine if the ARM architecture has the CLZ instruction. This is available on
architectures v5 and above. If available, redefine the macro for calculating the
lowest bit set. */
#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \
b = (UINT) __CLZ(m); \
b = 31 - b;
/* 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
@ -277,13 +278,36 @@ void _tx_initialize_start_interrupts(void);
is used to define a local function save area for the disable and restore
macros. */
UINT _tx_thread_interrupt_control(UINT new_posture);
/* The embedded assembler blocks are design so as to be inlinable by the
armlink linker inlining. This requires them to consist of either a
single 32-bit instruction, or either one or two 16-bit instructions
followed by a "BX lr". Note that to reduce the critical region size, the
16-bit "CPSID i" instruction is preceeded by a 16-bit NOP */
#define TX_INTERRUPT_SAVE_AREA UINT tx_saved_posture;
#ifdef TX_DISABLE_INLINE
#define TX_DISABLE tx_saved_posture = _tx_thread_interrupt_control(TX_INT_DISABLE);
unsigned int _tx_thread_interrupt_control(unsigned int new_posture);
#define TX_RESTORE _tx_thread_interrupt_control(tx_saved_posture);
#define TX_INTERRUPT_SAVE_AREA register int interrupt_save;
#define TX_DISABLE interrupt_save = _tx_thread_interrupt_control(TX_INT_DISABLE);
#define TX_RESTORE _tx_thread_interrupt_control(interrupt_save);
#else
#define TX_INTERRUPT_SAVE_AREA __istate_t interrupt_save;
#define TX_DISABLE {interrupt_save = __get_interrupt_state();__disable_interrupt();};
#define TX_RESTORE {__set_interrupt_state(interrupt_save);};
#endif
/* Define FPU extension for the Cortex-M4. Each is assumed to be called in the context of the executing
thread. */
void tx_thread_fpu_enable(void);
void tx_thread_fpu_disable(void);
/* Define the interrupt lockout macros for each ThreadX object. */
@ -300,27 +324,10 @@ UINT _tx_thread_interrupt_control(UINT new_posture);
#ifdef TX_THREAD_INIT
CHAR _tx_version_id[] =
"Copyright (c) 1996-2009 Express Logic Inc. * ThreadX Win32/Visual C/C++ Version G5.3.5.1 SN: Evaluation_Only_Version_071709 *";
"Copyright (c) 1996-2012 Express Logic Inc. * ThreadX Cortex-M4/IAR Version G5.5.5.1 SN: Evaluation_Only_Version_012012 *";
#else
extern CHAR _tx_version_id[];
#endif
/* Define externals for the Win32 port of ThreadX. */
extern CRITICAL_SECTION _tx_win32_critical_section;
extern HANDLE _tx_win32_semaphore;
extern ULONG _tx_win32_global_int_disabled_flag;
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

@ -1,381 +0,0 @@
/* 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;
/* 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-2008 Express Logic, Inc.\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

@ -1,142 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.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">
<ProjectGuid>{E909B566-818F-4E21-ADEC-7890514BB7AD}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/demo_threadx.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/demo_threadx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/demo_threadx.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/demo_threadx.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/demo_threadx.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/demo_threadx.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/demo_threadx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/demo_threadx.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/demo_threadx.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/demo_threadx.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\demo_threadx.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tx_api.h" />
<ClInclude Include="..\tx_port.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\tx.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{0f183280-1e5d-4269-aed9-53358fa9393f}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{578d0955-6137-44bb-bfd6-bc88254beea6}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{37f38d30-a601-47d6-90f8-e7ff86f72b68}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\demo_threadx.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tx_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\tx_port.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Library Include="..\tx.lib" />
</ItemGroup>
</Project>

View File

@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "QP/C++"
PROJECT_NUMBER = "5.6.1"
PROJECT_NUMBER = "5.6.2"
PROJECT_BRIEF =
PROJECT_LOGO = images/header_logo_ql.png
OUTPUT_DIRECTORY =
@ -27,11 +27,14 @@ MULTILINE_CPP_IS_BRIEF = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES = \
"next{1}=<hr><b>Next:</b> \ref \1</p>" \
"description=\par <b>Description</b>\n" \
"hint=\par <b>Hint</b>\n" \
"usage=@par <b>Usage</b>\n"
ALIASES += next{1}="<hr><b>Next:</b> @ref \1</p>"
ALIASES += description="@par <b>Description</b>"
ALIASES += hint="@par <b>Hint</b>@n"
ALIASES += usage="@par <b>Usage</b>@n"
ALIASES += reqdef{2}="<div class="vmargin20"></div>@anchor \1 <TABLE><TR ALIGN="left"><TH NOWRAP>\1</TH><TH WIDTH="100%">\2</TH></TR></TABLE>"
ALIASES += reqref{1}="@ref \1 \"\1\""
ALIASES += termdef{2}="@anchor term_\1 @par \2"
ALIASES += termref{1}="@ref term_\1"
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
@ -106,32 +109,34 @@ WARN_LOGFILE =
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = \
main.cc \
struct.cc \
modules.cc \
qs.cc \
exa.cc \
exa_apps.cc \
exa_native.cc \
exa_rtos.cc \
exa_os.cc \
exa_mware.cc \
ports.cc \
ports_native.cc \
ports_rtos.cc \
ports_os.cc \
history.cc \
main.dox \
gs.dox \
struct.dox \
../../doxygen/glossary.dox \
exa.dox \
exa_apps.dox \
exa_native.dox \
exa_rtos.dox \
exa_os.dox \
exa_mware.dox \
ports.dox \
ports_native.dox \
ports_rtos.dox \
ports_os.dox \
history.dox \
macros.h \
metrics.cc \
metrics.dox \
modules.dox \
../include \
../source \
../ports/lint \
../ports/lint/qk \
../ports/lint/qv
../ports/lint/qv \
../ports/lint/qxk
INPUT_ENCODING = UTF-8
FILE_PATTERNS = \
*.cc \
*.dox \
*.h \
*.c \
*.cpp \
@ -145,8 +150,7 @@ EXCLUDE = \
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = \
QP_IMPL
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = \
snippets \
@ -187,10 +191,10 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = ../../html/qpcpp
HTML_FILE_EXTENSION = .html
HTML_HEADER = header.html
HTML_FOOTER = footer.html
HTML_HEADER = ../../doxygen/header.html
HTML_FOOTER = ../../doxygen/footer.html
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = ql.css
HTML_EXTRA_STYLESHEET = ../../doxygen/ql.css
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
@ -309,7 +313,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY
PREDEFINED = Q_SPY QP_IMPL
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "QP/C++"
PROJECT_NUMBER = "5.6.1"
PROJECT_NUMBER = "5.6.2"
PROJECT_BRIEF =
PROJECT_LOGO = images/header_logo_ql.png
OUTPUT_DIRECTORY =
@ -27,11 +27,14 @@ MULTILINE_CPP_IS_BRIEF = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES = \
"next{1}=<hr><b>Next:</b> \ref \1</p>" \
"description=\par <b>Description</b>\n" \
"hint=\par <b>Hint</b>\n" \
"usage=@par <b>Usage</b>\n"
ALIASES += next{1}="<hr><b>Next:</b> @ref \1</p>"
ALIASES += description="@par <b>Description</b>"
ALIASES += hint="@par <b>Hint</b>@n"
ALIASES += usage="@par <b>Usage</b>@n"
ALIASES += reqdef{2}="<div class="vmargin20"></div>@anchor \1 <TABLE><TR ALIGN="left"><TH NOWRAP>\1</TH><TH WIDTH="100%">\2</TH></TR></TABLE>"
ALIASES += reqref{1}="@ref \1 \"\1\""
ALIASES += termdef{2}="@anchor term_\1 @par \2"
ALIASES += termref{1}="@ref term_\1"
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
@ -106,32 +109,34 @@ WARN_LOGFILE =
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = \
main.cc \
struct.cc \
modules.cc \
qs.cc \
exa.cc \
exa_apps.cc \
exa_native.cc \
exa_rtos.cc \
exa_os.cc \
exa_mware.cc \
ports.cc \
ports_native.cc \
ports_rtos.cc \
ports_os.cc \
history.cc \
main.dox \
gs.dox \
struct.dox \
../../doxygen/glossary.dox \
exa.dox \
exa_apps.dox \
exa_native.dox \
exa_rtos.dox \
exa_os.dox \
exa_mware.dox \
ports.dox \
ports_native.dox \
ports_rtos.dox \
ports_os.dox \
history.dox \
macros.h \
metrics.cc \
metrics.dox \
modules.dox \
../include \
../source \
../ports/lint \
../ports/lint/qk \
../ports/lint/qv
../ports/lint/qv \
../ports/lint/qxk
INPUT_ENCODING = UTF-8
FILE_PATTERNS = \
*.cc \
*.dox \
*.h \
*.c \
*.cpp \
@ -145,8 +150,7 @@ EXCLUDE = \
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = \
QP_IMPL
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = \
snippets \
@ -187,10 +191,10 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = tmp
HTML_FILE_EXTENSION = .html
HTML_HEADER = header.html
HTML_FOOTER = footer.html
HTML_HEADER = ../../doxygen/header.html
HTML_FOOTER = ../../doxygen/footer.html
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = ql.css
HTML_EXTRA_STYLESHEET = ../../doxygen/ql.css
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
@ -309,7 +313,7 @@ EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY
PREDEFINED = Q_SPY QP_IMPL
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------

View File

@ -1,17 +0,0 @@
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">
<a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com">&copy; Quantum Leaps</a> &nbsp;|&nbsp; <b>$projectname $projectnumber</b>
</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
<a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com">&copy; Quantum Leaps</a> &nbsp;|&nbsp; <b>$projectname $projectnumber</b>
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>

78
doxygen/gs.dox Normal file
View File

@ -0,0 +1,78 @@
/*! @page gs Getting Started
@section gs_help Using the QP&trade; Help
<p>You can use this QP&trade; Help in various ways: either sequentially from beginning to end or just by quickly locating the interesting topic.
</p>
@image html qp_help_using.jpg "QP Documentation View Features"
<div class="separate"></div>
@subsection gs_help_seq Reading QP&trade; Help Sequentially
You can move from topic to topic by means of the <span class="strong underline">Next:</span> link at the bottom of each page.
<div class="separate"></div>
@subsection gs_help_random Quickly Locating a Topic of Interest
You can use the following elements:
- the @ref gs_tree_view "Tree View" pane on the left-hand side of the browser;
- the **Table of Contents** box in the top-right corner of the page;
- the **Search** box in the upper-right corner of the browser window
<div class="separate"></div>
@subsection gs_tree_view Using the Tree View
The *Tree View* pane on the left-hand side of the browser displays the hierarchical Table of Contents, which can be either **linked-to** or **unlinked-from** the *Current Topic* displayed on the right-hand side. You can toggle between the two modes by pressing the **Link/Unlink Current Topic** icon at the top of the *Tree View* pane.
<img src="img/tree-view_linked.png" style="float:left; margin-right:10px;">
When the *Tree View* is **linked** to the Current Topic, the *Tree View* will always follow the currently viewed topic, by expanding and highlighting the pertinent section of the hierarchical Table of Contents.
<div style="clear:both;"></div>
<img src="img/tree-view_unlinked.png" style="float:left; margin-right:10px;">
When the *Tree View* is **unlinked** from the Current Topic, the *Tree View* will show only the explicitly selected section of the hierarchical Table of Contents and will **not** follow the topics activated by internal documentation links.
------------------------------------------------------------------------------
@section gs_an Getting Started with QP/C++ App Note
The Quantum Leaps Application Note <a class="extern" target="_blank" href="http://www.state-machine.com/doc/AN_Getting_Started_with_QPC.pdf"><strong>Getting Started with QP/C++</strong></a> provides step-by-step instructions on how to download, install, and get started with QP/C++ quickly.
@htmlonly
<div class="image">
<a target="_blank" href="http://www.state-machine.com/doc/AN_Getting_Started_with_QPCpp.pdf"><img border="0" src="img/AN_Getting_Started_with_QPCpp.jpg" title="Download PDF"></a>
<div class="caption">
Application Note: Getting Started with QP/C++
</div>
</div>
@endhtmlonly
------------------------------------------------------------------------------
@section gs_files Directories and Files
The following annotated directory tree lists the top-level directories provided in the standard QP/C++ distribution.
<ul class="tag">
<li><span class="img folder">qpc/</span>
</li>
<ul class="tag">
<li><span class="img folder">3rd_party/</span> &mdash; Third-Party code used in the QP/C++ @ref ports "ports" and @ref exa "examples"
</li>
<li><span class="img folder">examples/</span> &mdash; @ref exa "QP/C++ Examples"
</li>
<li><span class="img folder">ports/</span> &mdash; @ref ports "QP/C++ Ports"
</li>
<li><span class="img folder">include/</span> &mdash; Platform-independent QP/C++ API (see <a href="dir_d44c64559bbebec7f509842c48db8b23.html"><strong>include</strong></a>)
</li>
<li><span class="img folder">source/</span> &mdash; Platform-independent QP/C++ source code (see @ref <a href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html"><strong>source</strong></a>)
</li>
</ul>
</ul>
@note
The standard QP/C++ distribution contains many @ref exa "Example Projects", which are specifically designed to help you learn to use QP/C++ and to serve you as starting points for your own projects.
@next{struct}
*/

View File

@ -1,55 +0,0 @@
<!-- HTML header for doxygen 1.8.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Bluefish 2.2.4" />
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com"><img alt="Logo" src="$relpath^$projectlogo"/></a></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td style="padding-left: 0.5em;">
<div id="projectname">$projectname
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

View File

@ -2,6 +2,55 @@ namespace QP {
/** @page history Revision History
@section qpcpp_5_6_2 Version 5.6.2, 2016-03-31
The main purpose of this release is to introduce _atomic event multicasting_, meaning that event publishing to all subscribers is now protected from preemption. This eliminates potential for re-ordering of events under preemptive kernels (such as QK, QXK, or 3rd-party RTOSes), when events are published from low-priority AOs and some higher-priority subscribers can preempt multicasting and post/publish events of their own (before the original event is posted to all subscribers).
The atomic event multicasting is implemented by means of selective scheduler locking--very much like a priory-ceiling mutex. During event multicasting the scheduler gets locked, but only up to the highest-priority subscriber to a given event. The whole point here is that active objects with priorities above such "priority ceiling" are _not_ affected. Please see the discussion thread:
https://sourceforge.net/p/qpc/discussion/668726/thread/c186bf45
This release also changes the implementation of the priority-ceiling mutex in the preemptive built-in kernels: QK and QXK. Specifically, the implementation now re-uses the selective scheduler locking mechanism. In this new implementation, the QXMutex of the QXK kernel is much more efficient and lightweight, but it _cannot block_ while holding a mutex.
Finally, this release changes the QP ports to 3rd-party RTOSes by performing any RTOS operations (like posting events to message queues) outside critical sections. Also the ports have been augmented to support scheduler locking (this feature depends on what's available in the specific RTOSes).
Changes in detail:
1. Added scheduler locking to QF::publish_() in qf_ps.cpp. This feature is added in a portable way, via macros #QF_SCHED_STAT_TYPE_, QF_SCHED_LOCK_() and QF_SCHED_UNLOCK_(), which need to be implemented in every QP port.
2. Modified QV kernel to provide (dummy) implementation of selective scheduler locking.
3. Modified QK kernel to implement selective scheduler locking via modified priority-ceiling mutex QMutex.
4. Modified QXK kernel to implement selective scheduler locking via modified priority-ceiling mutex QXMutex.
5. Modified embOS port to provide (global) scheduler locking, which affects all priorities, because that's all embOS supports. Also, modified the embOS port to perform event posting outside the QF critical section.
6. Modified uC/OS-II port to provide (global) scheduler locking, which affects all priorities, because that's all uC/OS-II supports. Also, modified the uC/OS-II port to perform event posting outside the QF critical section.
7. Modified ThreadX port to provide selective scheduler locking, by means of "priority-threshold" available in ThreadX. Also, modified the ThreadX port to perform event posting outside the QF critical section.
8. Changed the ThreadX example to run on ARM Cortex-M4 board (STM32DiscoveryF4), instead of Win32 emulation (see qpcpp/examples/threadx/arm-cm/dpp_stm32f429-discovery).
9. Modified the Win32 port to provide (global) scheduler locking, which is implemented by Win32 critical section.
10. Fixed Bug#122 (QP didn't initiate some internal variables) https://sourceforge.net/p/qpc/bugs/122/ by adding explicit clearing of all QP variables in QF::init().
11. Modified the POSIX port to dummy-out scheduler locking. This means that this port currently does NOT lock scheduler around event publishing. (At this point it is not clear how to implement POSIX scheduler locking in a portable way.)
12. Modified QK and QXK examples in qpcpp/examples/arm-cm/dpp_ek-tm4c123gxl to demonstrate the usage of the new priority-ceiling mutexes.
13. Fixed the 3rd-party file startup_stm32l32l1xx.c to include exceptions for Cortex-M3 (MemManage_Handler, BusFault_Handler, and UsageFault_Handler).
14. Updated the 3rd-party files for the EK-TM4C123GXL board (TivaC LaunchPad).
15. Modified Makefiles for the EK-TM4C123GXL board with GNU-ARM toolset to define the symbol TARGET_IS_TM4C123_RB1 for compatibility with the updated 3rd-party files.
16. Implemented Feature Request #110 as well as the duplicate Request #62 by adding function QMActive::flushDeferred()
------------------------------------------------------------------------------
@section qpcpp_5_6_1 Version 5.6.1, 2016-01-01
This release is the first official (production) release of the new blocking @ref qxk "QXK kernel" ("eXtended Quantum Kernel"). QXK is a small, preemptive, priority-based, **blocking** kernel that provides most features you might expect of a traditional blocking RTOS kernel.

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -12,7 +12,7 @@
<img src="AN_OOP_in_C.jpg">
<img src="AN_Active_Objects_for_Embedded.jpg">
<img src="AN_Crash_Course_in_UML_State_Machines.jpg">
<img src="logo_qp.jpg">
<img src="logo_qp.gif">
<img src="board.png">
<img src="checkboxoff.png">
<img src="checkboxon.png">

BIN
doxygen/img/logo_qp.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,105 +0,0 @@
/*! @mainpage Getting Started
@tableofcontents
@htmlonly
<img style="float:right; margin:0 8px 8px 15px; clear:right;" src="img/logo_qp.jpg" title="QP">
@endhtmlonly
@section about About QP/C++
<p><a class="extern" target="_blank" href="http://www.state-machine.com/products/"><strong>QP/C++&trade; (Quantum Platform in C++)</strong></a> is a lightweight, open source <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Framework">active object (actor) framework</a> for building responsive and modular real-time embedded applications as systems of cooperating, event-driven <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Active">active objects</a> (<a href="http://en.wikipedia.org/wiki/Actor_model">actors</a>). The QP/C++&trade; framework is a member of a larger family consisting of QP/C++, <a href="http://www.state-machine.com/qpcpp" target="_blank" class="extern">QP/C</a>, and <a href="http://www.state-machine.com/qpcn" target="_blank" class="extern">QP-nano</a> frameworks, which are all strictly quality controlled, thoroughly documented, and <a href="http://www.state-machine.com/licensing" target="_blank" class="extern">commercially licensable</a>.
</p>
All QP&trade; frameworks can run on @ref exa_native "bare-metal single-chip microcontrollers", completely replacing a traditional Real-Time Operating System (RTOS). The frameworks contain a selection of built-in real-time kernels, such as the cooperative @ref comp_qv "QV kernel", the preemptive non-blocking @ref comp_qk "QK kernel", and the preemptive, blocking @ref comp_qxk "QXK kernel", <span class="highlight">which provides all the features you might expect from a traditional <strong>RTOS kernel</strong></span>. @ref ports_native "Native QP ports" and ready-to-use @ref exa_native "examples" are provided for major @ref exa_ref_mcu "CPU families".
QP/C++ can also work with many traditional @ref exa_rtos "RTOSes" and @ref exa_rtos "desktop OSes" (such as Windows and Linux).
The behavior of active objects is specified in QP by means of
<a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#HSM">hierarchical state machines (UML statecharts)</a>. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM&trade; modeling tool</a>.
The QP frameworks are used in <a href="http://www.state-machine.com/about/customers.html" target="_blank" class="extern">millions of products worldwide</a> in aerospace, medical devices, consumer electronics, wired and wireless telecommunications, industrial automation, transportation, robotics, and many more. The QP frameworks and the <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM modeling tool</a> receive over <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc/files/stats/timeline?dates=2015-01-01+to+2015-12-31">40,000 downloads a year</a>. The book, <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2" >Practical UML Statecharts in C/C++, 2nd Edition</a> provides a detailed design study of the QP frameworks and explains all the related concepts.
------------------------------------------------------------------------------
@section start Downloading and Installing QP/C++
QP/C++ is available for download from <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc/files/QP-C">SourceForge.net</a>--the world's biggest open source repository. The summary of available downloads is also available from <a class="extern" target="_blank" href="http://www.state-machine.com/downloads">Quantum Leaps download page</a>.
The Quantum Leaps Application Note <a class="extern" target="_blank" href="http://www.state-machine.com/doc/AN_Getting_Started_with_QPC.pdf"><strong>Getting Started with QP/C++</strong></a> provides step-by-step instructions on how to download, install, and get started with QP/C++ quickly.
@htmlonly
<div class="image">
<a target="_blank" href="http://www.state-machine.com/doc/AN_Getting_Started_with_QPCpp.pdf"><img border="0" src="img/AN_Getting_Started_with_QPCpp.jpg" title="Download PDF"></a>
<div class="caption">
Application Note: Getting Started with QP/C++
</div>
</div>
@endhtmlonly
The standard QP/C++ distribution contains also many @ref exa "Example Projects", which are specifically designed to help you learn to use QP/C++ and to serve you as starting points for your own projects.
------------------------------------------------------------------------------
@section qpcpp_files Directories and Files
The following annotated directory tree lists the top-level directories provided in the standard QP/C++ distribution.
<ul class="tag">
<li><span class="img folder">qpcpp/</span>
</li>
<ul class="tag">
<li><span class="img folder">3rd_party/</span> &mdash; Third-Party code used in the QP/C++ @ref ports "ports" and @ref exa "examples"
</li>
<li><span class="img folder">examples/</span> &mdash; @ref exa "QP/C++ Examples"
</li>
<li><span class="img folder">ports/</span> &mdash; @ref ports "QP/C++ Ports"
</li>
<li><span class="img folder">include/</span> &mdash; Platform-independent QP/C++ API (see <a href="dir_d44c64559bbebec7f509842c48db8b23.html"><strong>include</strong></a>)
</li>
<li><span class="img folder">source/</span> &mdash; Platform-independent QP/C++ source code (see @ref <a href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html"><strong>source</strong></a>)
</li>
</ul>
</ul>
------------------------------------------------------------------------------
@section support Help and Support
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.
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.
Training and consulting services are also available from Quantum Leaps. Please refer to the <a class="extern" target="_blank" href="http://www.state-machine.com/contact.html">Contact web-page</a> for more information.
------------------------------------------------------------------------------
@section licensing Licensing QP/C++
QP/C++ is licensed under the increasingly popular <a class="extern" target="_blank" href="http://www.state-machine.com/licensing">dual licensing model</a>, in which both the open source software distribution mechanism and traditional closed source software distribution models are combined.
@note If your company has a policy forbidding open source in your product, all QP frameworks can be licensed commercially, in which case you don't use any open source license and you do not violate your policy.
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.
Closed Source Projects:
-----------------------
If you are developing and distributing traditional closed source applications, you can purchase one of <a class="extern" target="_blank" href="http://www.state-machine.com/licensing/index.html#Commercial">Quantum Leaps commercial licenses</a>, which are specifically designed for users interested in retaining the proprietary status of their code. All Quantum Leaps commercial licenses expressly supersede the GPL open source license. This means that when you license Quantum Leaps software under a commercial license, you specifically do not use the software under the open source license and therefore you are not subject to any of its terms.
------------------------------------------------------------------------------
@section contact Contact Information
- Quantum Leaps Web site: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com</a>
- Quantum Leaps licensing: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com/licensing</a>
- QP/QM on SourceForge.net: <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc">sourceforge.net/projects/qpc</a>
- e-mail: <a class="extern" target="_blank" href="mailto:info@state-machine.com">info@state-machine.com</a>
@image html logo_ql_TM.jpg
Copyright &copy; 2002-2016 Quantum Leaps, LLC. All Rights Reserved.
@next{struct}
*/

119
doxygen/main.dox Normal file
View File

@ -0,0 +1,119 @@
/*! @mainpage About QP/C++&trade;
@tableofcontents
@section ab_about What is it?
<a class="extern" target="_blank" href="http://www.state-machine.com/products/"><strong>QP/C++&trade; (Quantum Platform in C++)</strong></a> is a lightweight, open source <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Framework"><strong>active object (actor) framework</strong></a> for building responsive and modular real-time embedded applications as systems of cooperating, event-driven <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Active"><strong>active objects</strong></a> (<a href="http://en.wikipedia.org/wiki/Actor_model">actors</a>). The QP/C++&trade; framework is a member of a larger family consisting of QP/C++, <a href="http://www.state-machine.com/qpc" target="_blank" class="extern">QP/C</a>, and <a href="http://www.state-machine.com/qpn" target="_blank" class="extern">QP-nano</a> frameworks, which are all strictly quality controlled, thoroughly documented, and available under @ref licensing "dual licensing model".
@attention
To use QP/C++&trade; effectively, you need to understand the <a href="http://www.state-machine.com/doc/concepts.html" target="_blank" class="extern"><strong>key concepts</strong></a> that underline the architecture of the framework and your applications based on the framework.
<div style="clear:both"></div>
------------------------------------------------------------------------------
@htmlonly
<img style="float:right; margin:10px 8px 8px 15px; clear:right;" src="img/logo_qp.gif" title="QP">
@endhtmlonly
@section ab_goals What does it do?
The main goals of the QP/C++&trade; framework are:
- to provide a reusable **architecture** based on <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Framework">active objects (actors)</a>, which is _safer_ and easier to understand than "free-threading" with a traditional RTOS.
- to provide a simple-to-use coding techniques for <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#HSM">hierarchical state machines</a>, with which to implement the behavior of active objects.
- to provide efficient and thread-safe event-driven mechanisms for active objects to communicate, such as direct event passing and publish-subscribe.
- to provide event-driven timing services (time events).
- to provide a selection of built-in real-time kernels to run the QP applications, such as the cooperative @ref qv "QV kernel", the preemptive non-blocking @ref qk "QK kernel", and the preemptive blocking @ref qxk "QXK kernel".
- to provide testing support for applications based on software tracing (@ref qs "Q-Spy").
- to provide portability layer and ready-to-use ports to @ref ports_rtos "3rd-party RTOSes" and desktop operating systems such as @ref posix "Linux" and @ref win32 "Windows".
- to provide a target for modeling and automatic code generation from the <a href="http://www.state-machine.com/qm" target="_blank" class="extern">QM modeling tool</a>.
------------------------------------------------------------------------------
@section ab_special What's special about it?
The QP/C++&trade; framework is a unique offering on the embedded software market. It provides a modern, reusable **architecture** of embedded applications, which combines object-orientation with the particular model of concurrency, known as <a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#Active"><strong>active objects</strong></a> (actors). This architecture is generally **safer**, more responsive and easier to understand than naked threads of a Real-Time Operating System (RTOS).
<div class="separate"></div>
@subsection oop Object Orientation
QP/C++&trade; is fundamentally an **object-oriented** framework, which means that the framework itself and your applications derived from the framework are fundamentally composed of <a href="https://en.wikipedia.org/wiki/Class_(computer_programming)" target="_blank" class="extern">classes</a> and only classes can have @ref sm "state machines" associated with them.
<div class="separate"></div>
@subsection lightweight Lightweight
The most unique characteristic of the QP/C++&trade; framework is its very small footprint, especially in RAM. In this respect, QP/C++&trade; requires less resources than even the smallest conventional Real-Time Operating System (RTOS) kernel. At the same time, QP gives you a much higher level of abstraction than a conventional RTOS. With QP, you work at the level of active objects, state machines and events, as opposed to "naked" threads of an RTOS.
<div class="separate"></div>
@subsection hsms Hierarchical State Machines
The behavior of active objects is specified in QP by means of
<a class="extern" target="_blank" href="http://www.state-machine.com/doc/concepts.html#HSM">hierarchical state machines (UML statecharts)</a>. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM&trade; modeling tool</a>.
<div class="separate"></div>
@subsection kernels Built-in Kernels
All QP/C++&trade; framework can run on @ref exa_native "bare-metal single-chip microcontrollers", completely replacing a traditional RTOS. The framework contain a selection of built-in real-time kernels, such as the cooperative @ref comp_qv "QV kernel", the preemptive non-blocking @ref comp_qk "QK kernel", and the preemptive, blocking @ref comp_qxk "QXK kernel", <span class="highlight">which provides all the features you might expect from a traditional <strong>RTOS kernel</strong></span>. @ref ports_native "Native QP ports" and ready-to-use @ref exa_native "examples" are provided for major @ref exa_ref_mcu "CPU families".
<div class="separate"></div>
@subsection inter Interoperability
QP/C++ can also work with many traditional @ref exa_rtos "RTOSes" and @ref exa_rtos "desktop OSes" (such as Windows and Linux).
<div class="separate"></div>
@subsection maturity Maturity
The QP&trade; family of embedded active object frameworks is one of the most mature in its class. It has been developed and refined for over 15 years.
The QP&trade; frameworks are used in <a href="http://www.state-machine.com/about/customers.html" target="_blank" class="extern">millions of products worldwide</a> in aerospace, medical devices, consumer electronics, wired and wireless telecommunications, industrial automation, transportation, robotics, and many more. The QP&trade; frameworks and the <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM&trade; modeling tool</a> receive over <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc/files/stats/timeline?dates=2015-01-01+to+2015-12-31">40,000 downloads a year</a>.
<div class="separate"></div>
@subsection psicc2 Book
The book, <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2" ><strong>Practical UML Statecharts in C/C++, 2nd Edition</strong></a> provides a detailed design study of the QP frameworks and explains all the related concepts.
@image html PSiCC2-3D.jpg "Practical UML Statecharts in C/C++, 2nd Edition"
------------------------------------------------------------------------------
@section licensing How is it licensed?
QP/C++ is licensed under the increasingly popular <a class="extern" target="_blank" href="http://www.state-machine.com/licensing">dual licensing model</a>, in which both the open source software distribution mechanism and traditional closed source software distribution models are combined.
@note If your company has a policy forbidding open source in your product, all QP frameworks can be licensed commercially, in which case you don't use any open source license and you do not violate your policy.
<div class="separate"></div>
@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.
<div class="separate"></div>
@subsection closed-source Closed Source Projects
If you are developing and distributing traditional closed source applications, you can purchase one of <a class="extern" target="_blank" href="http://www.state-machine.com/licensing/index.html#Commercial">Quantum Leaps commercial licenses</a>, which are specifically designed for users interested in retaining the proprietary status of their code. All Quantum Leaps commercial licenses expressly supersede the GPL open source license. This means that when you license Quantum Leaps software under a commercial license, you specifically do not use the software under the open source license and therefore you are not subject to any of its terms.
------------------------------------------------------------------------------
@section help 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.
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.
Training and consulting services are also available from Quantum Leaps. Please refer to the <a class="extern" target="_blank" href="http://www.state-machine.com/contact.html">Contact web-page</a> for more information.
------------------------------------------------------------------------------
@section contact Contact Information
- Quantum Leaps Web site: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com</a>
- Quantum Leaps licensing: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com/licensing</a>
- QP/QM on SourceForge.net: <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc">sourceforge.net/projects/qpc</a>
- e-mail: <a class="extern" target="_blank" href="mailto:info@state-machine.com">info@state-machine.com</a>
@image html logo_ql_TM.jpg
Copyright &copy; 2002-2016 Quantum Leaps, LLC. All Rights Reserved.
@next{gs}
*/

View File

@ -1,8 +1,8 @@
@echo off
:: ==========================================================================
:: Product: QP/C++ script for generating Doxygen documentation
:: Last Updated for Version: 5.6.1
:: Date of the Last Update: 2015-12-30
:: Last Updated for Version: 5.6.2
:: Date of the Last Update: 2016-03-30
::
:: Q u a n t u m L e a P s
:: ---------------------------
@ -38,13 +38,13 @@ echo usage:
echo make
echo make -CHM
set VERSION=5.6.1
set VERSION=5.6.2
:: Generate Resource Standard Metrics for QP/C++ .............................
set DOXHOME="C:\tools\doxygen\bin"
set RCMHOME="C:\tools\MSquared\M2 RSM"
set RSM_OUTPUT=metrics.cc
set RSM_OUTPUT=metrics.dox
set RSM_INPUT=..\include\*.h ..\source\*.h ..\source\*.cpp
echo /** @page metrics Code Metrics > %RSM_OUTPUT%

View File

@ -1,7 +1,7 @@
/** @page metrics Code Metrics
@code
Standard Code Metrics for QP/C++ 5.6.1
Standard Code Metrics for QP/C++ 5.6.2
Resource Standard Metrics (TM) for C, C++, C# and Java
Version 7.75 - mSquaredTechnologies.com
@ -9,7 +9,7 @@
License Type: Windows Single User License
Licensed To : Quantum Leaps, LLC
License No. : WS2975 License Date: Dec 15, 2013
Build Date : Sep 2 2009 Run Date: Feb 10, 2016
Build Date : Sep 2 2009 Run Date: Apr 01, 2016
(C)1996-2009 M Squared Technologies LLC
________________________________________________________________________
@ -282,7 +282,7 @@
~~ Total File Summary ~~
LOC 251 eLOC 236 lLOC 104 Comment 477 Lines 832
LOC 252 eLOC 237 lLOC 105 Comment 478 Lines 835
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -319,7 +319,7 @@
~~ Total File Summary ~~
LOC 68 eLOC 63 lLOC 19 Comment 101 Lines 186
LOC 81 eLOC 76 lLOC 24 Comment 109 Lines 208
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -573,7 +573,7 @@
~~ Total File Summary ~~
LOC 39 eLOC 35 lLOC 5 Comment 80 Lines 129
LOC 43 eLOC 39 lLOC 6 Comment 81 Lines 135
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -610,7 +610,7 @@
~~ Total File Summary ~~
LOC 84 eLOC 75 lLOC 30 Comment 118 Lines 218
LOC 94 eLOC 85 lLOC 34 Comment 122 Lines 232
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -654,7 +654,7 @@
~~ Total File Summary ~~
LOC 61 eLOC 56 lLOC 29 Comment 85 Lines 168
LOC 61 eLOC 56 lLOC 29 Comment 85 Lines 169
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -1082,7 +1082,7 @@
Function: QP::QMActive::defer
Parameters: (QEQueue * const eq, QEvt const * const e)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 21 Lines 3
LOC 3 eLOC 2 lLOC 1 Comment 22 Lines 3
Function: QP::QMActive::recall
Parameters: (QEQueue * const eq)
@ -1090,33 +1090,41 @@
Function Base : 1
Conditional if / else if: 2
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 15 eLOC 12 lLOC 8 Comment 29 Lines 27
LOC 15 eLOC 12 lLOC 8 Comment 30 Lines 27
Function: QP::QMActive::flushDeferred
Parameters: (QEQueue * const eq)
Cyclomatic Complexity Vg Detail
Function Base : 1
Loops for / foreach : 1
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 11 eLOC 8 lLOC 5 Comment 15 Lines 11
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 25 eLOC 20 lLOC 9 Comment 92 Lines 120
LOC 36 eLOC 28 lLOC 14 Comment 109 Lines 147
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 2
Total Function LOC.....: 18 Total Function Pts LOC : 0.5
Total Function eLOC....: 14 Total Function Pts eLOC: 0.4
Total Function lLOC....: 9 Total Function Pts lLOC: 0.2
Total Function Params .: 3 Total Function Return .: 2
Total Cyclo Complexity : 4 Total Function Complex.: 9
File Function Count....: 3
Total Function LOC.....: 29 Total Function Pts LOC : 0.7
Total Function eLOC....: 22 Total Function Pts eLOC: 0.5
Total Function lLOC....: 14 Total Function Pts lLOC: 0.3
Total Function Params .: 4 Total Function Return .: 3
Total Cyclo Complexity : 6 Total Function Complex.: 13
------ ----- ----- ------ ------ -----
Max Function LOC ......: 15 Average Function LOC ..: 9.00
Max Function eLOC .....: 12 Average Function eLOC .: 7.00
Max Function lLOC .....: 8 Average Function lLOC .: 4.50
Max Function LOC ......: 15 Average Function LOC ..: 9.67
Max Function eLOC .....: 12 Average Function eLOC .: 7.33
Max Function lLOC .....: 8 Average Function lLOC .: 4.67
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.50
Max Function Parameters: 2 Avg Function Parameters: 1.33
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.50
Max Interface Complex. : 3 Avg Interface Complex. : 2.33
Max Cyclomatic Complex.: 3 Avg Cyclomatic Complex.: 2.00
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.50
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.33
________________________________________________________________________
End of File: ..\source\qf_defer.cpp
@ -1278,14 +1286,14 @@
Function Base : 1
Loops while / do : 3
Loops for / foreach : 1
Conditional if / else if: 2
Conditional if / else if: 5
Logical and ( && ) : 10
Complexity Param 1 Return 1 Cyclo Vg 17 Total 19
LOC 106 eLOC 95 lLOC 52 Comment 105 Lines 207
Complexity Param 1 Return 1 Cyclo Vg 20 Total 22
LOC 119 eLOC 105 lLOC 57 Comment 111 Lines 233
NOTICE: The end of the source file has been reached where the
open brace count { 13 != 12 } close brace count
open brace count { 16 != 15 } close brace count
This is an indication of non-compilable code within the source
file. RSM processes all source code including code wrapped
with preprocessor directives. Accurate metrics requires that
@ -1294,27 +1302,27 @@
~~ Total File Summary ~~
LOC 127 eLOC 115 lLOC 57 Comment 183 Lines 321
LOC 140 eLOC 125 lLOC 62 Comment 189 Lines 348
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 2
Total Function LOC.....: 113 Total Function Pts LOC : 2.4
Total Function eLOC....: 101 Total Function Pts eLOC: 2.2
Total Function lLOC....: 55 Total Function Pts lLOC: 1.1
Total Function LOC.....: 126 Total Function Pts LOC : 2.6
Total Function eLOC....: 111 Total Function Pts eLOC: 2.4
Total Function lLOC....: 60 Total Function Pts lLOC: 1.2
Total Function Params .: 3 Total Function Return .: 2
Total Cyclo Complexity : 18 Total Function Complex.: 23
Total Cyclo Complexity : 21 Total Function Complex.: 26
------ ----- ----- ------ ------ -----
Max Function LOC ......: 106 Average Function LOC ..: 56.50
Max Function eLOC .....: 95 Average Function eLOC .: 50.50
Max Function lLOC .....: 52 Average Function lLOC .: 27.50
Max Function LOC ......: 119 Average Function LOC ..: 63.00
Max Function eLOC .....: 105 Average Function eLOC .: 55.50
Max Function lLOC .....: 57 Average Function lLOC .: 30.00
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.50
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.50
Max Cyclomatic Complex.: 17 Avg Cyclomatic Complex.: 9.00
Max Total Complexity ..: 19 Avg Total Complexity ..: 11.50
Max Cyclomatic Complex.: 20 Avg Cyclomatic Complex.: 10.50
Max Total Complexity ..: 22 Avg Total Complexity ..: 13.00
________________________________________________________________________
End of File: ..\source\qf_ps.cpp
@ -1579,7 +1587,7 @@
Function: QP::QF::init
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 13 eLOC 12 lLOC 8 Comment 18 Lines 21
LOC 14 eLOC 13 lLOC 9 Comment 19 Lines 21
Function: QP::QF::stop
Parameters: (void)
@ -1610,7 +1618,7 @@
Function Base : 1
Logical and ( && ) : 2
Complexity Param 6 Return 1 Cyclo Vg 3 Total 10
LOC 12 eLOC 10 lLOC 8 Comment 21 Lines 16
LOC 11 eLOC 9 lLOC 7 Comment 20 Lines 15
Function: QP::QMActive::stop
Parameters: (void)
@ -1622,35 +1630,35 @@
Cyclomatic Complexity Vg Detail
Function Base : 1
Loops while / do : 1
Conditional if / else if: 3
Complexity Param 1 Return 1 Cyclo Vg 5 Total 7
LOC 48 eLOC 43 lLOC 22 Comment 43 Lines 71
Conditional if / else if: 2
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 45 eLOC 41 lLOC 21 Comment 42 Lines 67
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 136 eLOC 117 lLOC 58 Comment 205 Lines 330
LOC 140 eLOC 120 lLOC 60 Comment 210 Lines 333
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 7
Total Function LOC.....: 98 Total Function Pts LOC : 2.6
Total Function eLOC....: 84 Total Function Pts eLOC: 2.2
Total Function lLOC....: 50 Total Function Pts lLOC: 1.1
Total Function LOC.....: 95 Total Function Pts LOC : 2.6
Total Function eLOC....: 82 Total Function Pts eLOC: 2.3
Total Function lLOC....: 49 Total Function Pts lLOC: 1.1
Total Function Params .: 7 Total Function Return .: 7
Total Cyclo Complexity : 15 Total Function Complex.: 29
Total Cyclo Complexity : 14 Total Function Complex.: 28
------ ----- ----- ------ ------ -----
Max Function LOC ......: 48 Average Function LOC ..: 14.00
Max Function eLOC .....: 43 Average Function eLOC .: 12.00
Max Function lLOC .....: 22 Average Function lLOC .: 7.14
Max Function LOC ......: 45 Average Function LOC ..: 13.57
Max Function eLOC .....: 41 Average Function eLOC .: 11.71
Max Function lLOC .....: 21 Average Function lLOC .: 7.00
------ ----- ----- ------ ------ -----
Max Function Parameters: 6 Avg Function Parameters: 1.00
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 7 Avg Interface Complex. : 2.00
Max Cyclomatic Complex.: 5 Avg Cyclomatic Complex.: 2.14
Max Total Complexity ..: 10 Avg Total Complexity ..: 4.14
Max Cyclomatic Complex.: 4 Avg Cyclomatic Complex.: 2.00
Max Total Complexity ..: 10 Avg Total Complexity ..: 4.00
________________________________________________________________________
End of File: ..\source\qk.cpp
@ -1659,56 +1667,53 @@
________________________________________________________________________
Function: QP::QMutex::init
Parameters: (uint_fast8_t const prioCeiling)
Cyclomatic Complexity Vg Detail
Function Base : 1
Logical and ( && ) : 2
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 11 eLOC 10 lLOC 6 Comment 18 Lines 20
Parameters: (uint_fast8_t const prio)
Complexity Param 1 Return 1 Cyclo Vg 1 Total 3
LOC 4 eLOC 3 lLOC 2 Comment 15 Lines 4
Function: QP::QMutex::lock
Parameters: (void)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 4
Logical and ( && ) : 2
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 35 eLOC 29 lLOC 15 Comment 26 Lines 53
Conditional if / else if: 1
Logical and ( && ) : 1
Complexity Param 0 Return 1 Cyclo Vg 3 Total 4
LOC 17 eLOC 15 lLOC 7 Comment 24 Lines 23
Function: QP::QMutex::unlock
Parameters: (void)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 4
Logical and ( && ) : 2
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 35 eLOC 29 lLOC 16 Comment 26 Lines 52
Conditional if / else if: 2
Logical and ( && ) : 1
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 19 lLOC 10 Comment 26 Lines 28
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 96 eLOC 82 lLOC 37 Comment 120 Lines 226
LOC 61 eLOC 53 lLOC 20 Comment 115 Lines 172
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 3
Total Function LOC.....: 81 Total Function Pts LOC : 1.8
Total Function eLOC....: 68 Total Function Pts eLOC: 1.5
Total Function lLOC....: 37 Total Function Pts lLOC: 0.7
Total Function LOC.....: 43 Total Function Pts LOC : 1.2
Total Function eLOC....: 37 Total Function Pts eLOC: 1.0
Total Function lLOC....: 19 Total Function Pts lLOC: 0.4
Total Function Params .: 1 Total Function Return .: 3
Total Cyclo Complexity : 17 Total Function Complex.: 21
Total Cyclo Complexity : 8 Total Function Complex.: 12
------ ----- ----- ------ ------ -----
Max Function LOC ......: 35 Average Function LOC ..: 27.00
Max Function eLOC .....: 29 Average Function eLOC .: 22.67
Max Function lLOC .....: 16 Average Function lLOC .: 12.33
Max Function LOC ......: 22 Average Function LOC ..: 14.33
Max Function eLOC .....: 19 Average Function eLOC .: 12.33
Max Function lLOC .....: 10 Average Function lLOC .: 6.33
------ ----- ----- ------ ------ -----
Max Function Parameters: 1 Avg Function Parameters: 0.33
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 2 Avg Interface Complex. : 1.33
Max Cyclomatic Complex.: 7 Avg Cyclomatic Complex.: 5.67
Max Total Complexity ..: 8 Avg Total Complexity ..: 7.00
Max Cyclomatic Complex.: 4 Avg Cyclomatic Complex.: 2.67
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.00
________________________________________________________________________
End of File: ..\source\qk_mutex.cpp
@ -2167,7 +2172,7 @@
________________________________________________________________________
Function: QP::thread_ao
Parameters: (void *par)
Parameters: (void * const par)
Cyclomatic Complexity Vg Detail
Function Base : 1
Loops for / foreach : 1
@ -2175,12 +2180,12 @@
LOC 7 eLOC 5 lLOC 4 Comment 5 Lines 8
Function: QP::thread_idle
Parameters: (void *par)
Parameters: (void * const)
Cyclomatic Complexity Vg Detail
Function Base : 1
Loops for / foreach : 1
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 9 eLOC 7 lLOC 6 Comment 3 Lines 11
LOC 8 eLOC 6 lLOC 5 Comment 3 Lines 9
Function: QP::QF::init
Parameters: (void)
@ -2206,7 +2211,7 @@
Conditional if / else if: 1
Logical and ( && ) : 5
Complexity Param 6 Return 1 Cyclo Vg 7 Total 14
LOC 22 eLOC 19 lLOC 12 Comment 23 Lines 28
LOC 23 eLOC 20 lLOC 11 Comment 22 Lines 29
Function: QP::QMActive::stop
Parameters: (void)
@ -2217,7 +2222,7 @@
LOC 10 eLOC 9 lLOC 6 Comment 15 Lines 14
Function: QP::QXK::init
Parameters: (void *idleStkSto, uint_fast16_t idleStkSize)
Parameters: (void * const idleStkSto, uint_fast16_t const idleStkSize)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 9 eLOC 8 lLOC 5 Comment 12 Lines 13
@ -2230,7 +2235,7 @@
~~ Total File Summary ~~
LOC 128 eLOC 110 lLOC 62 Comment 184 Lines 318
LOC 128 eLOC 110 lLOC 60 Comment 184 Lines 317
------------------------------------------------------------------------
~~ File Functional Summary ~~
@ -2238,13 +2243,13 @@
File Function Count....: 9
Total Function LOC.....: 86 Total Function Pts LOC : 2.4
Total Function eLOC....: 73 Total Function Pts eLOC: 2.1
Total Function lLOC....: 52 Total Function Pts lLOC: 1.2
Total Function lLOC....: 50 Total Function Pts lLOC: 1.1
Total Function Params .: 10 Total Function Return .: 9
Total Cyclo Complexity : 18 Total Function Complex.: 37
------ ----- ----- ------ ------ -----
Max Function LOC ......: 22 Average Function LOC ..: 9.56
Max Function eLOC .....: 19 Average Function eLOC .: 8.11
Max Function lLOC .....: 12 Average Function lLOC .: 5.78
Max Function LOC ......: 23 Average Function LOC ..: 9.56
Max Function eLOC .....: 20 Average Function eLOC .: 8.11
Max Function lLOC .....: 11 Average Function lLOC .: 5.56
------ ----- ----- ------ ------ -----
Max Function Parameters: 6 Avg Function Parameters: 1.11
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
@ -2259,56 +2264,54 @@
________________________________________________________________________
Function: QP::QXMutex::init
Parameters: (uint_fast8_t const prioCeiling)
Cyclomatic Complexity Vg Detail
Function Base : 1
Logical and ( && ) : 2
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 13 eLOC 12 lLOC 7 Comment 17 Lines 21
Parameters: (uint_fast8_t const prio)
Complexity Param 1 Return 1 Cyclo Vg 1 Total 3
LOC 4 eLOC 3 lLOC 2 Comment 15 Lines 4
Function: QP::QXMutex::lock
Parameters: (void)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 4
Logical and ( && ) : 2
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 38 eLOC 32 lLOC 17 Comment 25 Lines 57
Conditional if / else if: 1
Inlined if-else ( ? : ) : 1
Logical and ( && ) : 1
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 20 lLOC 9 Comment 28 Lines 29
Function: QP::QXMutex::unlock
Parameters: (void)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 4
Logical and ( && ) : 2
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 47 eLOC 41 lLOC 23 Comment 30 Lines 72
Conditional if / else if: 2
Logical and ( && ) : 1
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 19 lLOC 10 Comment 27 Lines 28
------------------------------------------------------------------------
~~ Total File Summary ~~
LOC 113 eLOC 99 lLOC 47 Comment 122 Lines 248
LOC 66 eLOC 58 lLOC 22 Comment 120 Lines 180
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 3
Total Function LOC.....: 98 Total Function Pts LOC : 2.1
Total Function eLOC....: 85 Total Function Pts eLOC: 1.9
Total Function lLOC....: 47 Total Function Pts lLOC: 0.9
Total Function LOC.....: 48 Total Function Pts LOC : 1.2
Total Function eLOC....: 42 Total Function Pts eLOC: 1.1
Total Function lLOC....: 21 Total Function Pts lLOC: 0.4
Total Function Params .: 1 Total Function Return .: 3
Total Cyclo Complexity : 17 Total Function Complex.: 21
Total Cyclo Complexity : 9 Total Function Complex.: 13
------ ----- ----- ------ ------ -----
Max Function LOC ......: 47 Average Function LOC ..: 32.67
Max Function eLOC .....: 41 Average Function eLOC .: 28.33
Max Function lLOC .....: 23 Average Function lLOC .: 15.67
Max Function LOC ......: 22 Average Function LOC ..: 16.00
Max Function eLOC .....: 20 Average Function eLOC .: 14.00
Max Function lLOC .....: 10 Average Function lLOC .: 7.00
------ ----- ----- ------ ------ -----
Max Function Parameters: 1 Avg Function Parameters: 0.33
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 2 Avg Interface Complex. : 1.33
Max Cyclomatic Complex.: 7 Avg Cyclomatic Complex.: 5.67
Max Total Complexity ..: 8 Avg Total Complexity ..: 7.00
Max Cyclomatic Complex.: 4 Avg Cyclomatic Complex.: 3.00
Max Total Complexity ..: 5 Avg Total Complexity ..: 4.33
________________________________________________________________________
End of File: ..\source\qxk_mutex.cpp
@ -2395,7 +2398,7 @@
Conditional if / else if: 2
Logical and ( && ) : 4
Complexity Param 6 Return 1 Cyclo Vg 7 Total 14
LOC 22 eLOC 18 lLOC 10 Comment 8 Lines 32
LOC 21 eLOC 17 lLOC 9 Comment 8 Lines 31
Function: QP::QXThread::post_
Parameters: (QEvt const * const e, uint_fast16_t const margin)
@ -2413,7 +2416,7 @@
Function: QP::QXThread::block_
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 4 eLOC 3 lLOC 2 Comment 2 Lines 4
LOC 5 eLOC 4 lLOC 3 Comment 3 Lines 6
Function: QP::QXThread::unblock_
Parameters: (void)
@ -2422,7 +2425,7 @@
Conditional if / else if: 1
Logical and ( && ) : 1
Complexity Param 0 Return 1 Cyclo Vg 3 Total 4
LOC 8 eLOC 5 lLOC 2 Comment 3 Lines 10
LOC 8 eLOC 5 lLOC 2 Comment 4 Lines 9
Function: QP::QXThread::teArm_
Parameters: (enum_t const sig, uint_fast16_t const nTicks, uint_fast8_t
@ -2477,13 +2480,13 @@
~~ Total File Summary ~~
LOC 219 eLOC 179 lLOC 96 Comment 136 Lines 371
LOC 220 eLOC 180 lLOC 96 Comment 138 Lines 372
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 15
Total Function LOC.....: 185 Total Function Pts LOC : 4.1
Total Function LOC.....: 185 Total Function Pts LOC : 4.2
Total Function eLOC....: 146 Total Function Pts eLOC: 3.4
Total Function lLOC....: 96 Total Function Pts lLOC: 1.8
Total Function Params .: 20 Total Function Return .: 15
@ -2510,9 +2513,9 @@
~~ Total Project Summary ~~
LOC 5592 eLOC 4912 lLOC 2274 Comment 6407 Lines 12375
LOC 5567 eLOC 4892 lLOC 2253 Comment 6444 Lines 12356
Average per File, metric/41 files
LOC 136 eLOC 119 lLOC 55 Comment 156 Lines 301
LOC 135 eLOC 119 lLOC 54 Comment 157 Lines 301
------------------------------------------------------------------------
@ -2943,12 +2946,17 @@
Function: QP::QMActive::defer
Parameters: (QEQueue * const eq, QEvt const * const e)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 3 eLOC 2 lLOC 1 Comment 21 Lines 3
LOC 3 eLOC 2 lLOC 1 Comment 22 Lines 3
Function: QP::QMActive::recall
Parameters: (QEQueue * const eq)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 15 eLOC 12 lLOC 8 Comment 29 Lines 27
LOC 15 eLOC 12 lLOC 8 Comment 30 Lines 27
Function: QP::QMActive::flushDeferred
Parameters: (QEQueue * const eq)
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 11 eLOC 8 lLOC 5 Comment 15 Lines 11
Function: QP::QF::poolInit
Parameters: (void * const poolSto, uint_fast32_t const poolSize, uint_fa
@ -3010,8 +3018,8 @@
Function: QP::QF::publish_
Parameters: (QEvt const * const e)
Complexity Param 1 Return 1 Cyclo Vg 17 Total 19
LOC 106 eLOC 95 lLOC 52 Comment 105 Lines 207
Complexity Param 1 Return 1 Cyclo Vg 20 Total 22
LOC 119 eLOC 105 lLOC 57 Comment 111 Lines 233
Function: QP::QActive::QActive
Parameters: (QStateHandler const initial)
@ -3112,7 +3120,7 @@
Function: QP::QF::init
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 13 eLOC 12 lLOC 8 Comment 18 Lines 21
LOC 14 eLOC 13 lLOC 9 Comment 19 Lines 21
Function: QP::QF::stop
Parameters: (void)
@ -3134,7 +3142,7 @@
const qLen, void * const stkSto, uint_fast16_t const stkSize
, QEvt const * const ie)
Complexity Param 6 Return 1 Cyclo Vg 3 Total 10
LOC 12 eLOC 10 lLOC 8 Comment 21 Lines 16
LOC 11 eLOC 9 lLOC 7 Comment 20 Lines 15
Function: QP::QMActive::stop
Parameters: (void)
@ -3143,23 +3151,23 @@
Function: QK_sched_
Parameters: (uint_fast8_t p)
Complexity Param 1 Return 1 Cyclo Vg 5 Total 7
LOC 48 eLOC 43 lLOC 22 Comment 43 Lines 71
Complexity Param 1 Return 1 Cyclo Vg 4 Total 6
LOC 45 eLOC 41 lLOC 21 Comment 42 Lines 67
Function: QP::QMutex::init
Parameters: (uint_fast8_t const prioCeiling)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 11 eLOC 10 lLOC 6 Comment 18 Lines 20
Parameters: (uint_fast8_t const prio)
Complexity Param 1 Return 1 Cyclo Vg 1 Total 3
LOC 4 eLOC 3 lLOC 2 Comment 15 Lines 4
Function: QP::QMutex::lock
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 35 eLOC 29 lLOC 15 Comment 26 Lines 53
Complexity Param 0 Return 1 Cyclo Vg 3 Total 4
LOC 17 eLOC 15 lLOC 7 Comment 24 Lines 23
Function: QP::QMutex::unlock
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 35 eLOC 29 lLOC 16 Comment 26 Lines 52
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 19 lLOC 10 Comment 26 Lines 28
Function: QP::QS::initBuf
Parameters: (uint8_t sto[], uint_fast16_t const stoSize)
@ -3365,14 +3373,14 @@
LOC 3 eLOC 2 lLOC 1 Comment 12 Lines 3
Function: QP::thread_ao
Parameters: (void *par)
Parameters: (void * const par)
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 7 eLOC 5 lLOC 4 Comment 5 Lines 8
Function: QP::thread_idle
Parameters: (void *par)
Parameters: (void * const)
Complexity Param 1 Return 1 Cyclo Vg 2 Total 4
LOC 9 eLOC 7 lLOC 6 Comment 3 Lines 11
LOC 8 eLOC 6 lLOC 5 Comment 3 Lines 9
Function: QP::QF::init
Parameters: (void)
@ -3394,7 +3402,7 @@
const qLen, void * const stkSto, uint_fast16_t const stkSize
, QEvt const * const ie)
Complexity Param 6 Return 1 Cyclo Vg 7 Total 14
LOC 22 eLOC 19 lLOC 12 Comment 23 Lines 28
LOC 23 eLOC 20 lLOC 11 Comment 22 Lines 29
Function: QP::QMActive::stop
Parameters: (void)
@ -3402,7 +3410,7 @@
LOC 10 eLOC 9 lLOC 6 Comment 15 Lines 14
Function: QP::QXK::init
Parameters: (void *idleStkSto, uint_fast16_t idleStkSize)
Parameters: (void * const idleStkSto, uint_fast16_t const idleStkSize)
Complexity Param 2 Return 1 Cyclo Vg 1 Total 4
LOC 9 eLOC 8 lLOC 5 Comment 12 Lines 13
@ -3412,19 +3420,19 @@
LOC 10 eLOC 9 lLOC 6 Comment 11 Lines 12
Function: QP::QXMutex::init
Parameters: (uint_fast8_t const prioCeiling)
Complexity Param 1 Return 1 Cyclo Vg 3 Total 5
LOC 13 eLOC 12 lLOC 7 Comment 17 Lines 21
Parameters: (uint_fast8_t const prio)
Complexity Param 1 Return 1 Cyclo Vg 1 Total 3
LOC 4 eLOC 3 lLOC 2 Comment 15 Lines 4
Function: QP::QXMutex::lock
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 38 eLOC 32 lLOC 17 Comment 25 Lines 57
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 20 lLOC 9 Comment 28 Lines 29
Function: QP::QXMutex::unlock
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 7 Total 8
LOC 47 eLOC 41 lLOC 23 Comment 30 Lines 72
Complexity Param 0 Return 1 Cyclo Vg 4 Total 5
LOC 22 eLOC 19 lLOC 10 Comment 27 Lines 28
Function: QP::QXSemaphore::init
Parameters: (uint_fast16_t const count)
@ -3461,7 +3469,7 @@
const qLen, void * const stkSto, uint_fast16_t const stkSize
, QEvt const * const)
Complexity Param 6 Return 1 Cyclo Vg 7 Total 14
LOC 22 eLOC 18 lLOC 10 Comment 8 Lines 32
LOC 21 eLOC 17 lLOC 9 Comment 8 Lines 31
Function: QP::QXThread::post_
Parameters: (QEvt const * const e, uint_fast16_t const margin)
@ -3476,12 +3484,12 @@
Function: QP::QXThread::block_
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 1 Total 2
LOC 4 eLOC 3 lLOC 2 Comment 2 Lines 4
LOC 5 eLOC 4 lLOC 3 Comment 3 Lines 6
Function: QP::QXThread::unblock_
Parameters: (void)
Complexity Param 0 Return 1 Cyclo Vg 3 Total 4
LOC 8 eLOC 5 lLOC 2 Comment 3 Lines 10
LOC 8 eLOC 5 lLOC 2 Comment 4 Lines 9
Function: QP::QXThread::teArm_
Parameters: (enum_t const sig, uint_fast16_t const nTicks, uint_fast8_t
@ -3520,32 +3528,32 @@
LOC 56 eLOC 48 lLOC 32 Comment 24 Lines 74
Total: Functions
LOC 3378 eLOC 2805 lLOC 1727 InCmp 401 CycloCmp 558
Function Points FP(LOC) 59.6 FP(eLOC) 49.9 FP(lLOC) 30.9
LOC 3311 eLOC 2747 lLOC 1690 InCmp 403 CycloCmp 545
Function Points FP(LOC) 58.3 FP(eLOC) 48.8 FP(lLOC) 30.2
------------------------------------------------------------------------
~~ Project Functional Analysis ~~
Total Functions .......: 196 Total Physical Lines ..: 4404
Total LOC .............: 3378 Total Function Pts LOC : 59.6
Total eLOC ............: 2805 Total Function Pts eLOC: 49.9
Total lLOC.............: 1727 Total Function Pts lLOC: 30.9
Total Cyclomatic Comp. : 558 Total Interface Comp. .: 401
Total Parameters ......: 205 Total Return Points ...: 196
Total Comment Lines ...: 2545 Total Blank Lines .....: 519
Total Functions .......: 197 Total Physical Lines ..: 4276
Total LOC .............: 3311 Total Function Pts LOC : 58.3
Total eLOC ............: 2747 Total Function Pts eLOC: 48.8
Total lLOC.............: 1690 Total Function Pts lLOC: 30.2
Total Cyclomatic Comp. : 545 Total Interface Comp. .: 403
Total Parameters ......: 206 Total Return Points ...: 197
Total Comment Lines ...: 2561 Total Blank Lines .....: 497
------ ----- ----- ------ ------ -----
Avg Physical Lines ....: 22.47
Avg LOC ...............: 17.23 Avg eLOC ..............: 14.31
Avg lLOC ..............: 8.81 Avg Cyclomatic Comp. ..: 2.85
Avg Physical Lines ....: 21.71
Avg LOC ...............: 16.81 Avg eLOC ..............: 13.94
Avg lLOC ..............: 8.58 Avg Cyclomatic Comp. ..: 2.77
Avg Interface Comp. ...: 2.05 Avg Parameters ........: 1.05
Avg Return Points .....: 1.00 Avg Comment Lines .....: 12.98
Avg Return Points .....: 1.00 Avg Comment Lines .....: 13.00
------ ----- ----- ------ ------ -----
Max LOC ...............: 260
Max eLOC ..............: 202 Max lLOC ..............: 125
Max Cyclomatic Comp. ..: 57 Max Interface Comp. ...: 7
Max Parameters ........: 6 Max Return Points .....: 1
Max Comment Lines .....: 105 Max Total Lines .......: 273
Max Comment Lines .....: 111 Max Total Lines .......: 273
------ ----- ----- ------ ------ -----
Min LOC ...............: 1
Min eLOC ..............: 1 Min lLOC ..............: 0

View File

@ -182,6 +182,13 @@ As you can see in the list below, <span class="highlight">QXK provides most feat
- QP::QMPool::get()
- QP::QMPool::put()
*/
/*! @defgroup qs QS
@brief
Software Tracing Instrumentation
QS is software tracing system that enables developers to monitor live event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code. QS is an ideal tool for testing, troubleshooting, and optimizing QP applications. QS can even be used to support acceptance testing in product manufacturing.
*/
/*###########################################################################*/ /*! @dir ../include

View File

@ -1,240 +0,0 @@
/* QL overrides ---------------------------------------------- */
h1 { font-size: 135%; }
h2 { font-size: 115%; }
h3 { font-size: 105%; }
h1.groupheader { font-size: 110%; }
h2.groupheader { font-size: 105%; }
h3.groupheader { font-size: 100%; }
pre.fragment { line-height: 100%; font-size: 13px; }
div.line { line-height: 100%;}
div.toc {
padding: 10px 10px;
margin: 0 10px 10px 10px;
}
hr {
height: 0px;
border: none;
border-top: 2px solid #4A6AAA;
margin-top: 25px;
}
/* QL additions ---------------------------------------------- */
/*
#titlearea {
background: #FFFFFF url(img/header_bg.png) repeat-x;
}
*/
#projectlogo {
display: block;
min-width: 180px;
vertical-align: top;
}
#projectname {
padding-left:20px;
/*text-align: center;*/
}
.title {
color: #354C7B;
}
h1, h2, h3, h4, h5, h6 {
color: #354C7B;
}
a.extern {
background:url(img/extern.png) no-repeat right;
padding-right: 14px;
text-decoration:none;
}
a.pdf {
background:url(img/pdf.gif) no-repeat right;
padding-right: 18px;
text-decoration:none;
}
.extern:hover {
text-decoration:underline;
}
pre.code {
background-color: #EEEEEE;
}
img {
max-width:100%;
height:auto;
}
img.left {
float: left;
padding-right: 10px;
}
img.right {
float: right;
padding-left: 10px;
}
table.indextable {
border: 1px solid #777;
border-collapse: collapse;
background-color: #f0f0f0;
font-size: 100%;
}
table.indextable th {
text-align: left;
text-indent:5px;
}
table.indextable td {
border: 1px solid #777;
border-collapse: collapse;
vertical-align: top;
}
table.indextable ul {
margin-left:20px;
}
table.indextable ul {padding-left:8px;}
.highlight {background-color:#EEEE77; }
.menu {background-color:#dddddd; }
.underline {text-decoration:underline; }
.strong {background-color:#ffff33; font-weight:bold; }
.preprocessor, span.preprocessor a {color:darkblue; }
.comment {color: darkred; font-style:italic; }
.string, span.char { color: darkgreen; }
.separate {
border: none;
border-top: 1px #bfbfbf solid;
margin-top: 20px;
/*width: 300px;*/
}
.vmargin10 {margin-top: 10px;}
.vmargin20 {margin-top: 20px;}
.button {
border-style: solid;
border-color: white #625f5d #625f5d #eeeeee;
border-width: 2px;
font-size: 10pt;
color: black;
background-color: #d4d0c8;
white-space: nowrap;
padding-left: 2px;
padding-right: 2px;
}
.button:hover {
border-style: solid;
border-color: #625f5d #eeeeee #eeeeee #625f5d;
border-width: 2px;
font-size: 10pt;
color: black;
background-color: #d4d0c8;
white-space: nowrap;
padding-left: 2px;
padding-right: 2px;
}
.checkbox {
background:url(img/checkboxoff.png) no-repeat 2px 2px;
padding-left: 16px;
font-family: Tahoma;
font-size: 10pt;
background-color: #d4d0c8;
color: black;
white-space: nowrap;
}
.checkbox:hover {
background:url(img/checkboxon.png) no-repeat 2px 2px;
font-size: 10pt;
background-color: #d4d0c8;
padding-left: 16px;
color: black;
white-space: nowrap;
}
.radio {
background:url(img/radiooff.png) no-repeat 2px 2px;
font-size: 10pt;
background-color: #d4d0c8;
padding-left: 14px;
color: black;
white-space: nowrap;
}
.radio:hover {
background:url(img/radioon.png) no-repeat 2px 2px;
font-size: 10pt;
background-color: #d4d0c8;
padding-left: 14px;
color: black;
white-space: nowrap;
}
.board {
background: url(img/board.png) no-repeat;
background-position: right;
padding: 2px 20px 0px 0px;
font-weight: bold;
}
.img {
padding-left: 20px;
white-space: nowrap;
color: blue;
}
dl.note {
margin: 0px 10px 0px 0px;
padding: 5px 15px 10px 15px;
background-color: #FFFFEE;
border: 1px solid #EEEE77;
/*border-radius: 7px 7px 7px 7px;*/
border-radius: 0;
}
dl.attention {
margin: 0px 10px 0px 0px;
padding: 5px 15px 10px 15px;
background-color: #FFCC00;
border: 1px solid #CCA300;
border-radius: 0;
}
dl.remark {
margin: 0px 10px 0px 0px;
padding: 10px 15px 10px 15px;
background-color: #EEEEFF;
border: 1px solid #CCCCFF;
border-radius: 0;
}
ul.tag {list-style-type:none;}
span.tag {
background-color:#000;
color:#fff;
font-weight:bold;
padding:0 4px 0 4px;
margin: 0 6px 0 -25px;
}
span.bullet {
background-color:#f00;
border-radius: 7px 7px 7px 7px;
color:#fff;
font-weight:bold;
padding:0 4px 0 4px;
margin: 0 6px 0 -25px;
}
div.clear { clear: both; }
div.toc {
width:230px;
}
#preview{
position:absolute;
border:1px solid #ccc;
background:#77f;
padding:2px;
display:none;
color:#fff;
}
/* icons ----------------------------------------------------- */
.qp_link {background:url(img/qp_link.png) no-repeat;}
.folder {background:url(img/folder.png) no-repeat;}
.file {background:url(img/file.png) no-repeat;}
.file_doc {background:url(img/file_doc.png) no-repeat;}
.file_h {background:url(img/file_header.png) no-repeat;}
.file_c {background:url(img/file_source_c.png) no-repeat;}
.file_cpp {background:url(img/file_source_cpp.png) no-repeat;}
.file_ino {background:url(img/file_source_ino.png) no-repeat;}
.file_tcl {background:url(img/file_source_tcl.png) no-repeat;}
.file_mak {background:url(img/file_make.png) no-repeat;}

View File

@ -1,8 +0,0 @@
/*!
@defgroup qs QS
@brief
Software Tracing Instrumentation
QS is software tracing system that enables developers to monitor live event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code. QS is an ideal tool for testing, troubleshooting, and optimizing QP applications. QS can even be used to support acceptance testing in product manufacturing.
*/

View File

@ -1,29 +1,7 @@
/*! @page struct Structure and Concepts
/*! @page struct Structure and Features
@tableofcontents
@section event_driven Event-Driven Programming
Virtually all embedded systems are **event-driven** by nature, which means that they continuously wait for the occurrence of some internal or external event such as a time tick, an arrival of some data, a button press, or a touch on a touch-screen. After recognizing the event, such systems *react* by performing the appropriate computation that may include manipulating the hardware or generating "soft" events that trigger other internal software components. Once the event-handling is complete, the software goes back to waiting for the next event.
However, most embedded systems are traditionally programmed in a **sequential** manner, where a program waits for *specific* events in various places in its execution path by either busy-polling or blocking on semaphore or other such mechanism of a traditional Real-Time Operating System (RTOS). Example of the basic sequential code is the traditional "Blinky" implementation:
@code{.c}
while (1) { /* RTOS task or a "superloop" */
BSP_ledOn(); /* turn the LED on */
RTOS_delay(400); /* wait for 400 ms */
BSP_ledOff(); /* turn the LED off */
RTOS_delay(600); /* wait for 600 ms */
}
@endcode
Although this approach is functional in many situations, it does not work very well when there are multiple possible events whose arrival times and order you cannot predict and where it is important to handle the events in a timely manner. The fundamental problem is that while a sequential program is waiting for one kind of event (e.g., elapsing of a time interval) it is not doing anything else and is **not responsive** to other events (e.g., a button press).
For this and other reasons experienced developers turn to the long-known design strategy called **event-driven programming**, which requires a distinctly different way of thinking than conventional sequential programs. All event-driven programs are naturally divided into the application, which actually handles the events, and the supervisory event-driven infrastructure (**framework**), which waits for events and dispatches them to the application. The control resides in the event-driven framework, so from the application standpoint, the control is *inverted* compared to a traditional sequential program.
The **QP/C++ framework** brings together two most effective techniques of structuring event-driven embedded systems: <a href="http://www.state-machine.com/doc/concepts.html#Active" target="_blank" class="extern">active objects</a> and <a href="http://www.state-machine.com/doc/concepts.html#HSM" target="_blank" class="extern">hierarchical state machines</a> (UML statecharts). The following sections describe the main components and structure of the framework.
------------------------------------------------------------------------------
@section comp Components of QP/C++
<p>As shown in the diagram below, the QP/C++ framework has a layered structure. The Target hardware sits at the bottom. The Board Support Package (BSP) above it provides access to the board-specific features, such as the peripherals. The real-time kernel (QV, QK, QXK, or a conventional 3rd-party RTOS) provides the foundation for multitasking, such as task scheduling, context-switching, and inter-task communication. Based on these services, the event-driven framework (QF) supplies the event-driven infrastructure for executing <a href="http://www.state-machine.com/doc/concepts.html#Active" target="_blank" class="extern">active objects</a> and ensuring thread-safe event-driven exchanges among them. Finally, the event-processor (QEP) implements the hierarchical state machine semantics (based on UML statecharts). The top layer is the application-level code consisting of loosely-coupled active objects.
</p>

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, Blinky on EK-TM4C123GXL, QK kernel, GNU-ARM
# Last Updated for Version: 5.6.0
# Date of the Last Update: 2015-12-26
# Last Updated for Version: 5.6.2
# Date of the Last Update: 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------
@ -132,7 +132,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
DEFINES := -DTARGET_IS_TM4C123_RB1
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, Blinky on EK-TM4C123GXL, QV kernel, GNU-ARM
# Last Updated for Version: 5.6.0
# Date of the Last Update: 2015-12-26
# Last Updated for Version: 5.6.2
# Date of the Last Update: 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------
@ -130,7 +130,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
DEFINES := -DTARGET_IS_TM4C123_RB1
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, Blinky console, Win32-QV, MinGW
# Last updated for version 5.5.0
# Last updated on 2015-09-25
# Last updated for version 5.6.2
# Last updated on 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------

View File

@ -38,7 +38,7 @@
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 225 42 Info 740: Unusual pointer cast (incompatible indirect types) [MISRA C++ Rule 5-2-6], [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 284 38 Note 929: cast from pointer to pointer [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 284 38 Info 740: Unusual pointer cast (incompatible indirect types) [MISRA C++ Rule 5-2-6], [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\include\qf.h" 447 1 Warning 551: Symbol 'QP::QF_SUBSCR_LIST_SIZE' (line 447, file C:\qp\qpcpp\include\qf.h) not accessed [MISRA C++ Rule 0-1-4]
"C:\qp\qpcpp\include\qf.h" 450 1 Warning 551: Symbol 'QP::QF_SUBSCR_LIST_SIZE' (line 450, file C:\qp\qpcpp\include\qf.h) not accessed [MISRA C++ Rule 0-1-4]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 102 1 Info 754: local struct member 'target' (line 102, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp) not referenced
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 103 1 Info 754: local struct member 'act' (line 103, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp) not referenced
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp" 164 1 Info 754: local struct member 'target' (line 164, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\philo.cpp) not referenced
@ -79,7 +79,7 @@
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 277 38 Info 740: Unusual pointer cast (incompatible indirect types) [MISRA C++ Rule 5-2-6], [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 324 38 Note 929: cast from pointer to pointer [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 324 38 Info 740: Unusual pointer cast (incompatible indirect types) [MISRA C++ Rule 5-2-6], [MISRA C++ Rule 5-2-7]
"C:\qp\qpcpp\include\qf.h" 447 1 Warning 551: Symbol 'QP::QF_SUBSCR_LIST_SIZE' (line 447, file C:\qp\qpcpp\include\qf.h) not accessed [MISRA C++ Rule 0-1-4]
"C:\qp\qpcpp\include\qf.h" 450 1 Warning 551: Symbol 'QP::QF_SUBSCR_LIST_SIZE' (line 450, file C:\qp\qpcpp\include\qf.h) not accessed [MISRA C++ Rule 0-1-4]
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 95 1 Info 754: local struct member 'target' (line 95, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp) not referenced
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 96 1 Info 754: local struct member 'act' (line 96, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp) not referenced
"C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp" 268 1 Info 754: local struct member 'target' (line 268, file C:\qp\qpcpp\examples\arm-cm\dpp_ek-tm4c123gxl\table.cpp) not referenced
@ -199,76 +199,78 @@
"C:\qp\qpcpp\include\qf.h" 228 1 Warning 1526: Member function 'QP::QMActive::defer(QP::QEQueue *, const struct QP::QEvt *) const' (line 228, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 231 1 Info 1714: Member function 'QP::QMActive::recall(QP::QEQueue *)' (line 231, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 231 1 Warning 1526: Member function 'QP::QMActive::recall(QP::QEQueue *)' (line 231, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 234 1 Info 1714: Member function 'QP::QMActive::getPrio(void) const' (line 234, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 239 1 Info 1714: Member function 'QP::QMActive::setPrio(unsigned int)' (line 239, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 246 1 Info 1714: Member function 'QP::QMActive::getOsObject(void)' (line 246, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 252 1 Info 1714: Member function 'QP::QMActive::getThread(void)' (line 252, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 256 1 Info 1714: Member function 'QP::QMActive::get_(void)' (line 256, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 256 1 Warning 1526: Member function 'QP::QMActive::get_(void)' (line 256, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 296 1 Warning 1526: Member function 'QP::QActive::init(const struct QP::QEvt *)' (line 296, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 297 1 Warning 1526: Member function 'QP::QActive::init(void)' (line 297, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 298 1 Info 1716: Virtual member function 'QP::QActive::dispatch(const struct QP::QEvt *)' (line 298, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 298 1 Warning 1526: Member function 'QP::QActive::dispatch(const struct QP::QEvt *)' (line 298, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 300 1 Info 1714: Member function 'QP::QActive::isIn(unsigned int (*)(void *, const struct QP::QEvt *))' (line 300, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 300 1 Warning 1526: Member function 'QP::QActive::isIn(unsigned int (*)(void *, const struct QP::QEvt *))' (line 300, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 304 1 Info 1714: Member function 'QP::QActive::QActive(unsigned int (*)(void *, const struct QP::QEvt *))' (line 304, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 304 1 Warning 1526: Member function 'QP::QActive::QActive(unsigned int (*)(void *, const struct QP::QEvt *))' (line 304, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 372 1 Warning 1526: Member function 'QP::QTimeEvt::QTimeEvt(QP::QMActive *, int, unsigned char)' (line 372, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 376 1 Warning 1526: Member function 'QP::QTimeEvt::armX(unsigned short, unsigned short)' (line 376, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 380 1 Warning 1526: Member function 'QP::QTimeEvt::disarm(void)' (line 380, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 383 1 Info 1714: Member function 'QP::QTimeEvt::rearm(unsigned short)' (line 383, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 383 1 Warning 1526: Member function 'QP::QTimeEvt::rearm(unsigned short)' (line 383, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 386 1 Info 1714: Member function 'QP::QTimeEvt::ctr(void) const' (line 386, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 386 1 Warning 1526: Member function 'QP::QTimeEvt::ctr(void) const' (line 386, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 391 1 Info 1714: Member function 'QP::QTimeEvt::QTimeEvt(int)' (line 391, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 409 1 Info 1714: Member function 'QP::QTimeEvt::postIn(QP::QMActive *, unsigned short)' (line 409, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 415 1 Info 1714: Member function 'QP::QTimeEvt::postEvery(QP::QMActive *, unsigned short)' (line 415, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 423 1 Warning 1526: Member function 'QP::QTimeEvt::QTimeEvt(void)' (line 423, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 432 1 Info 1714: Member function 'QP::QTimeEvt::toActive(void)' (line 432, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 435 1 Info 1714: Member function 'QP::QTimeEvt::toTimeEvt(void)' (line 435, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 485 1 Info 1714: Member function 'QP::QF::getVersion(void)' (line 485, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 490 1 Info 1714: Member function 'QP::QF::init(void)' (line 490, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 490 1 Warning 1526: Member function 'QP::QF::init(void)' (line 490, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 493 1 Info 1714: Member function 'QP::QF::psInit(QP::QSubscrList *, int)' (line 493, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 493 1 Warning 1526: Member function 'QP::QF::psInit(QP::QSubscrList *, int)' (line 493, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 497 1 Info 1714: Member function 'QP::QF::poolInit(void *, unsigned int, unsigned int)' (line 497, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 497 1 Warning 1526: Member function 'QP::QF::poolInit(void *, unsigned int, unsigned int)' (line 497, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 501 1 Info 1714: Member function 'QP::QF::poolGetMaxBlockSize(void)' (line 501, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 501 1 Warning 1526: Member function 'QP::QF::poolGetMaxBlockSize(void)' (line 501, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 505 1 Info 1714: Member function 'QP::QF::run(void)' (line 505, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 505 1 Warning 1526: Member function 'QP::QF::run(void)' (line 505, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 508 1 Info 1714: Member function 'QP::QF::onStartup(void)' (line 508, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 508 1 Warning 1526: Member function 'QP::QF::onStartup(void)' (line 508, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 511 1 Info 1714: Member function 'QP::QF::onCleanup(void)' (line 511, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 511 1 Warning 1526: Member function 'QP::QF::onCleanup(void)' (line 511, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 515 1 Info 1714: Member function 'QP::QF::stop(void)' (line 515, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 515 1 Warning 1526: Member function 'QP::QF::stop(void)' (line 515, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 523 1 Warning 1526: Member function 'QP::QF::publish_(const struct QP::QEvt *, const void *)' (line 523, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 526 1 Info 1714: Member function 'QP::QF::tickX_(unsigned char, const void *)' (line 526, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 526 1 Warning 1526: Member function 'QP::QF::tickX_(unsigned char, const void *)' (line 526, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 532 1 Info 1714: Member function 'QP::QF::noTimeEvtsActiveX(unsigned char)' (line 532, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 532 1 Warning 1526: Member function 'QP::QF::noTimeEvtsActiveX(unsigned char)' (line 532, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 537 1 Info 1714: Member function 'QP::QF::getPoolMin(unsigned int)' (line 537, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 537 1 Warning 1526: Member function 'QP::QF::getPoolMin(unsigned int)' (line 537, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 541 1 Info 1714: Member function 'QP::QF::getQueueMin(unsigned int)' (line 541, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 541 1 Warning 1526: Member function 'QP::QF::getQueueMin(unsigned int)' (line 541, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 544 1 Warning 1526: Member function 'QP::QF::newX_(unsigned int, unsigned int, int)' (line 544, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 548 1 Info 1714: Member function 'QP::QF::gc(const struct QP::QEvt *)' (line 548, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 548 1 Warning 1526: Member function 'QP::QF::gc(const struct QP::QEvt *)' (line 548, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 551 1 Info 1714: Member function 'QP::QF::newRef_(const struct QP::QEvt *, const struct QP::QEvt *)' (line 551, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 551 1 Warning 1526: Member function 'QP::QF::newRef_(const struct QP::QEvt *, const struct QP::QEvt *)' (line 551, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 555 1 Info 1714: Member function 'QP::QF::remove_(const QP::QMActive *)' (line 555, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 555 1 Warning 1526: Member function 'QP::QF::remove_(const QP::QMActive *)' (line 555, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 558 1 Info 1715: static member 'QP::QF::active_' (line 558, file C:\qp\qpcpp\include\qf.h) not referenced
"C:\qp\qpcpp\include\qf.h" 558 1 Warning 1527: static member 'QP::QF::active_' (line 558, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 561 1 Info 1714: Member function 'QP::QF::thread_(QP::QMActive *)' (line 561, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 561 1 Warning 1526: Member function 'QP::QF::thread_(QP::QMActive *)' (line 561, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 564 1 Info 1714: Member function 'QP::QF::add_(QP::QMActive *)' (line 564, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 564 1 Warning 1526: Member function 'QP::QF::add_(QP::QMActive *)' (line 564, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 567 1 Info 1714: Member function 'QP::QF::bzero(void *, unsigned int)' (line 567, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 567 1 Warning 1526: Member function 'QP::QF::bzero(void *, unsigned int)' (line 567, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 573 1 Info 1715: static member 'QP::QF::timeEvtHead_' (line 573, file C:\qp\qpcpp\include\qf.h) not referenced
"C:\qp\qpcpp\include\qf.h" 573 1 Warning 1527: static member 'QP::QF::timeEvtHead_' (line 573, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 234 1 Info 1714: Member function 'QP::QMActive::flushDeferred(QP::QEQueue *) const' (line 234, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 234 1 Warning 1526: Member function 'QP::QMActive::flushDeferred(QP::QEQueue *) const' (line 234, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 237 1 Info 1714: Member function 'QP::QMActive::getPrio(void) const' (line 237, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 242 1 Info 1714: Member function 'QP::QMActive::setPrio(unsigned int)' (line 242, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 249 1 Info 1714: Member function 'QP::QMActive::getOsObject(void)' (line 249, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 255 1 Info 1714: Member function 'QP::QMActive::getThread(void)' (line 255, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 259 1 Info 1714: Member function 'QP::QMActive::get_(void)' (line 259, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 259 1 Warning 1526: Member function 'QP::QMActive::get_(void)' (line 259, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 299 1 Warning 1526: Member function 'QP::QActive::init(const struct QP::QEvt *)' (line 299, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 300 1 Warning 1526: Member function 'QP::QActive::init(void)' (line 300, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 301 1 Info 1716: Virtual member function 'QP::QActive::dispatch(const struct QP::QEvt *)' (line 301, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 301 1 Warning 1526: Member function 'QP::QActive::dispatch(const struct QP::QEvt *)' (line 301, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 303 1 Info 1714: Member function 'QP::QActive::isIn(unsigned int (*)(void *, const struct QP::QEvt *))' (line 303, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 303 1 Warning 1526: Member function 'QP::QActive::isIn(unsigned int (*)(void *, const struct QP::QEvt *))' (line 303, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 307 1 Info 1714: Member function 'QP::QActive::QActive(unsigned int (*)(void *, const struct QP::QEvt *))' (line 307, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 307 1 Warning 1526: Member function 'QP::QActive::QActive(unsigned int (*)(void *, const struct QP::QEvt *))' (line 307, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 375 1 Warning 1526: Member function 'QP::QTimeEvt::QTimeEvt(QP::QMActive *, int, unsigned char)' (line 375, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 379 1 Warning 1526: Member function 'QP::QTimeEvt::armX(unsigned short, unsigned short)' (line 379, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 383 1 Warning 1526: Member function 'QP::QTimeEvt::disarm(void)' (line 383, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 386 1 Info 1714: Member function 'QP::QTimeEvt::rearm(unsigned short)' (line 386, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 386 1 Warning 1526: Member function 'QP::QTimeEvt::rearm(unsigned short)' (line 386, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 389 1 Info 1714: Member function 'QP::QTimeEvt::ctr(void) const' (line 389, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 389 1 Warning 1526: Member function 'QP::QTimeEvt::ctr(void) const' (line 389, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 394 1 Info 1714: Member function 'QP::QTimeEvt::QTimeEvt(int)' (line 394, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 412 1 Info 1714: Member function 'QP::QTimeEvt::postIn(QP::QMActive *, unsigned short)' (line 412, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 418 1 Info 1714: Member function 'QP::QTimeEvt::postEvery(QP::QMActive *, unsigned short)' (line 418, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 426 1 Warning 1526: Member function 'QP::QTimeEvt::QTimeEvt(void)' (line 426, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 435 1 Info 1714: Member function 'QP::QTimeEvt::toActive(void)' (line 435, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 438 1 Info 1714: Member function 'QP::QTimeEvt::toTimeEvt(void)' (line 438, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 488 1 Info 1714: Member function 'QP::QF::getVersion(void)' (line 488, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 493 1 Info 1714: Member function 'QP::QF::init(void)' (line 493, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 493 1 Warning 1526: Member function 'QP::QF::init(void)' (line 493, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 496 1 Info 1714: Member function 'QP::QF::psInit(QP::QSubscrList *, int)' (line 496, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 496 1 Warning 1526: Member function 'QP::QF::psInit(QP::QSubscrList *, int)' (line 496, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 500 1 Info 1714: Member function 'QP::QF::poolInit(void *, unsigned int, unsigned int)' (line 500, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 500 1 Warning 1526: Member function 'QP::QF::poolInit(void *, unsigned int, unsigned int)' (line 500, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 504 1 Info 1714: Member function 'QP::QF::poolGetMaxBlockSize(void)' (line 504, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 504 1 Warning 1526: Member function 'QP::QF::poolGetMaxBlockSize(void)' (line 504, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 508 1 Info 1714: Member function 'QP::QF::run(void)' (line 508, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 508 1 Warning 1526: Member function 'QP::QF::run(void)' (line 508, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 511 1 Info 1714: Member function 'QP::QF::onStartup(void)' (line 511, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 511 1 Warning 1526: Member function 'QP::QF::onStartup(void)' (line 511, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 514 1 Info 1714: Member function 'QP::QF::onCleanup(void)' (line 514, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 514 1 Warning 1526: Member function 'QP::QF::onCleanup(void)' (line 514, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 518 1 Info 1714: Member function 'QP::QF::stop(void)' (line 518, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 518 1 Warning 1526: Member function 'QP::QF::stop(void)' (line 518, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 526 1 Warning 1526: Member function 'QP::QF::publish_(const struct QP::QEvt *, const void *)' (line 526, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 529 1 Info 1714: Member function 'QP::QF::tickX_(unsigned char, const void *)' (line 529, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 529 1 Warning 1526: Member function 'QP::QF::tickX_(unsigned char, const void *)' (line 529, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 535 1 Info 1714: Member function 'QP::QF::noTimeEvtsActiveX(unsigned char)' (line 535, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 535 1 Warning 1526: Member function 'QP::QF::noTimeEvtsActiveX(unsigned char)' (line 535, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 540 1 Info 1714: Member function 'QP::QF::getPoolMin(unsigned int)' (line 540, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 540 1 Warning 1526: Member function 'QP::QF::getPoolMin(unsigned int)' (line 540, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 544 1 Info 1714: Member function 'QP::QF::getQueueMin(unsigned int)' (line 544, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 544 1 Warning 1526: Member function 'QP::QF::getQueueMin(unsigned int)' (line 544, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 547 1 Warning 1526: Member function 'QP::QF::newX_(unsigned int, unsigned int, int)' (line 547, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 551 1 Info 1714: Member function 'QP::QF::gc(const struct QP::QEvt *)' (line 551, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 551 1 Warning 1526: Member function 'QP::QF::gc(const struct QP::QEvt *)' (line 551, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 554 1 Info 1714: Member function 'QP::QF::newRef_(const struct QP::QEvt *, const struct QP::QEvt *)' (line 554, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 554 1 Warning 1526: Member function 'QP::QF::newRef_(const struct QP::QEvt *, const struct QP::QEvt *)' (line 554, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 558 1 Info 1714: Member function 'QP::QF::remove_(const QP::QMActive *)' (line 558, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 558 1 Warning 1526: Member function 'QP::QF::remove_(const QP::QMActive *)' (line 558, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 561 1 Info 1715: static member 'QP::QF::active_' (line 561, file C:\qp\qpcpp\include\qf.h) not referenced
"C:\qp\qpcpp\include\qf.h" 561 1 Warning 1527: static member 'QP::QF::active_' (line 561, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 564 1 Info 1714: Member function 'QP::QF::thread_(QP::QMActive *)' (line 564, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 564 1 Warning 1526: Member function 'QP::QF::thread_(QP::QMActive *)' (line 564, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 567 1 Info 1714: Member function 'QP::QF::add_(QP::QMActive *)' (line 567, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 567 1 Warning 1526: Member function 'QP::QF::add_(QP::QMActive *)' (line 567, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 570 1 Info 1714: Member function 'QP::QF::bzero(void *, unsigned int)' (line 570, file C:\qp\qpcpp\include\qf.h) not referenced [MISRA C++ Rule 0-1-10]
"C:\qp\qpcpp\include\qf.h" 570 1 Warning 1526: Member function 'QP::QF::bzero(void *, unsigned int)' (line 570, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qf.h" 576 1 Info 1715: static member 'QP::QF::timeEvtHead_' (line 576, file C:\qp\qpcpp\include\qf.h) not referenced
"C:\qp\qpcpp\include\qf.h" 576 1 Warning 1527: static member 'QP::QF::timeEvtHead_' (line 576, file C:\qp\qpcpp\include\qf.h) not defined
"C:\qp\qpcpp\include\qs.h" 76 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_EMPTY' (line 76, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 79 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QEP_STATE_ENTRY' (line 79, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 80 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QEP_STATE_EXIT' (line 80, file C:\qp\qpcpp\include\qs.h) not referenced
@ -319,11 +321,11 @@
"C:\qp\qpcpp\include\qs.h" 127 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QF_MPOOL_GET_ATTEMPT' (line 127, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 128 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QF_RESERVED1' (line 128, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 129 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QF_RESERVED0' (line 129, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 132 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QK_MUTEX_LOCK' (line 132, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 133 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QK_MUTEX_UNLOCK' (line 133, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 134 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QVK_SCHEDULE' (line 134, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 135 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QVK_IDLE' (line 135, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 136 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QK_RESUME' (line 136, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 132 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_SCHED_LOCK' (line 132, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 133 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_SCHED_UNLOCK' (line 133, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 134 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_SCHED_NEXT' (line 134, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 135 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_SCHED_IDLE' (line 135, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 136 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_SCHED_RESUME' (line 136, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 139 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QEP_TRAN_HIST' (line 139, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 140 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QEP_TRAN_EP' (line 140, file C:\qp\qpcpp\include\qs.h) not referenced
"C:\qp\qpcpp\include\qs.h" 141 1 Info 769: global enumeration constant 'QP::QSpyRecords::QS_QEP_TRAN_XP' (line 141, file C:\qp\qpcpp\include\qs.h) not referenced
@ -461,13 +463,13 @@ Count Type Number Text
2 Warning 551 Symbol '___' (___) not accessed
2 Warning 553 Undefined preprocessor variable '___', assumed 0
2 Warning 618 Storage class specified after a type
107 Warning 1526 Member function '___' (___) not defined
108 Warning 1526 Member function '___' (___) not defined
5 Warning 1527 static member '___' (___) not defined
7 Info 740 Unusual pointer cast (incompatible indirect types)
14 Info 754 local ___ member '___' (___) not referenced
3 Info 758 global ___ '___' (___) not referenced
105 Info 769 global enumeration constant '___' (___) not referenced
119 Info 1714 Member function '___' (___) not referenced
120 Info 1714 Member function '___' (___) not referenced
4 Info 1715 static member '___' (___) not referenced
6 Info 1716 Virtual member function '___' (___) not referenced
16 Note 929 cast from ___ to ___

View File

@ -269,7 +269,7 @@ uint32_t BSP::random(void) { // a very cheap pseudo-random-number generator
}
//............................................................................
void BSP::randomSeed(uint32_t seed) {
l_rndMutex.init(N_PHILO + 1U);
l_rndMutex.init(N_PHILO); // ceiling <== maximum Philo priority
l_rnd = seed;
}
//............................................................................

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, DPP on EK-TM4C123GXL, QK kernel, GNU-ARM
# Last Updated for Version: 5.6.0
# Date of the Last Update: 2015-12-26
# Last Updated for Version: 5.6.2
# Date of the Last Update: 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------
@ -133,7 +133,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
DEFINES := -DTARGET_IS_TM4C123_RB1
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,13 +1,13 @@
//****************************************************************************
// DPP example
// Last updated for version 5.6.0
// Last updated on 2015-12-26
// Last updated for version 5.6.2
// Last updated on 2016-03-31
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
// 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
@ -28,8 +28,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Contact information:
// Web: www.state-machine.com
// Email: info@state-machine.com
// http://www.state-machine.com
// mailto:info@state-machine.com
//****************************************************************************
#include "qpcpp.h"
#include "dpp.h"
@ -69,8 +69,7 @@ int main() {
philoQueueSto[n], Q_DIM(philoQueueSto[n]),
(void *)0, 0U);
}
// leave the priority level (N_PHILO + 1) free for the mutex in BSP
DPP::AO_Table->start((uint_fast8_t)(N_PHILO + 2U),
DPP::AO_Table->start((uint_fast8_t)(N_PHILO + 1U),
tableQueueSto, Q_DIM(tableQueueSto),
(void *)0, 0U);

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, DPP on EK-TM4C123GXL, QV kernel, GNU-ARM
# Last Updated for Version: 5.6.0
# Date of the Last Update: 2015-12-26
# Last Updated for Version: 5.6.2
# Date of the Last Update: 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------
@ -131,7 +131,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
DEFINES := -DTARGET_IS_TM4C123_RB1
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,7 +1,7 @@
///***************************************************************************
// Product: DPP example, EK-TM4C123GXL board, preemptive QXK kernel
// Last updated for version 5.6.0
// Last updated on 2015-12-28
// Last updated for version 5.6.2
// Last updated on 2016-03-31
//
// Q u a n t u m L e a P s
// ---------------------------
@ -187,30 +187,8 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
/* NOTE: The VFP (hardware Floating Point) unit is configured by QXK */
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos); //???
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF
@ -269,7 +247,7 @@ uint32_t BSP::random(void) { // a very cheap pseudo-random-number generator
}
//............................................................................
void BSP::randomSeed(uint32_t seed) {
l_rndMutex.init(N_PHILO + 1U);
l_rndMutex.init(N_PHILO); // ceiling <== maximum Philo priority
l_rnd = seed;
}
//............................................................................

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++, DPP on EK-TM4C123GXL, QXK kernel, GNU-ARM
# Last Updated for Version: 5.6.0
# Date of the Last Update: 2015-12-26
# Last Updated for Version: 5.6.2
# Date of the Last Update: 2016-03-31
#
# Q u a n t u m L e a P s
# ---------------------------
@ -136,7 +136,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES :=
DEFINES := -DTARGET_IS_TM4C123_RB1
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -24,7 +24,7 @@ set BUILD_DIR=dbg
if [%1] NEQ [] set BUILD_DIR=%1
@echo on
%LMFLASH% -q ek-tm4c123gxl %BUILD_DIR%\dpp-qk.bin
%LMFLASH% -q ek-tm4c123gxl %BUILD_DIR%\dpp-qxk.bin
@echo.
@echo.

View File

@ -1,13 +1,13 @@
//****************************************************************************
// DPP example for QXK
// Last updated for version 5.6.0
// Last updated on 2015-12-26
// Last updated for version 5.6.2
// Last updated on 2016-03-31
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
// 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
@ -28,8 +28,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Contact information:
// Web: www.state-machine.com
// Email: info@state-machine.com
// http://www.state-machine.com
// mailto:info@state-machine.com
//****************************************************************************
#include "qpcpp.h"
#include "dpp.h"
@ -83,10 +83,8 @@ int main() {
static_cast<QP::QEvt *>(0)); // initialization event
}
// leave the priority level (N_PHILO + 1) free for the mutex in BSP
DPP::AO_Table->start(
static_cast<uint_fast8_t>(N_PHILO + 2), // QP priority of the AO
static_cast<uint_fast8_t>(N_PHILO + 1), // QP priority of the AO
tableQueueSto, // event queue storage
Q_DIM(tableQueueSto), // queue length [events]
tableStackSto, // stack storage

View File

@ -0,0 +1,385 @@
//****************************************************************************
// Product: DPP example, STM32F4-Discovery board, ThreadX kernel
// Last updated for version 5.6.2
// Last updated on 2016-03-12
//
// 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:
// http://www.state-machine.com
// mailto:info@state-machine.com
//****************************************************************************
#include "qpcpp.h"
#include "dpp.h"
#include "bsp.h"
#include "stm32f4xx.h" // CMSIS-compliant header file for the MCU used
#include "stm32f4xx_exti.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_usart.h"
// add other drivers if necessary...
Q_DEFINE_THIS_FILE
// namespace DPP *************************************************************
namespace DPP {
// Local-scope objects -------------------------------------------------------
#define LED_GPIO_PORT GPIOD
#define LED_GPIO_CLK RCC_AHB1Periph_GPIOD
#define LED4_PIN GPIO_Pin_12
#define LED3_PIN GPIO_Pin_13
#define LED5_PIN GPIO_Pin_14
#define LED6_PIN GPIO_Pin_15
#define BTN_GPIO_PORT GPIOA
#define BTN_GPIO_CLK RCC_AHB1Periph_GPIOA
#define BTN_B1 GPIO_Pin_0
static unsigned l_rnd; // random seed
#ifdef Q_SPY
QP::QSTimeCtr QS_tickTime_;
QP::QSTimeCtr QS_tickPeriod_;
enum AppRecords { // application-specific trace records
PHILO_STAT = QP::QS_USER
};
#endif
extern "C" {
// ISRs used in this project =================================================
} // extern "C"
// BSP functions =============================================================
void BSP_init(void) {
// NOTE: SystemInit() already called from the startup code
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
// Explictily Disable the automatic FPU state preservation as well as
// the FPU lazy stacking
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// Initialize thr port for the LEDs
RCC_AHB1PeriphClockCmd(LED_GPIO_CLK , ENABLE);
// GPIO Configuration for the LEDs...
GPIO_InitTypeDef GPIO_struct;
GPIO_struct.GPIO_Mode = GPIO_Mode_OUT;
GPIO_struct.GPIO_OType = GPIO_OType_PP;
GPIO_struct.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_struct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_struct.GPIO_Pin = LED3_PIN;
GPIO_Init(LED_GPIO_PORT, &GPIO_struct);
LED_GPIO_PORT->BSRRH = LED3_PIN; // turn LED off
GPIO_struct.GPIO_Pin = LED4_PIN;
GPIO_Init(LED_GPIO_PORT, &GPIO_struct);
LED_GPIO_PORT->BSRRH = LED4_PIN; // turn LED off
GPIO_struct.GPIO_Pin = LED5_PIN;
GPIO_Init(LED_GPIO_PORT, &GPIO_struct);
LED_GPIO_PORT->BSRRH = LED5_PIN; // turn LED off
GPIO_struct.GPIO_Pin = LED6_PIN;
GPIO_Init(LED_GPIO_PORT, &GPIO_struct);
LED_GPIO_PORT->BSRRH = LED6_PIN; // turn LED off
// Initialize thr port for Button
RCC_AHB1PeriphClockCmd(BTN_GPIO_CLK , ENABLE);
// GPIO Configuration for the Button...
GPIO_struct.GPIO_Pin = BTN_B1;
GPIO_struct.GPIO_Mode = GPIO_Mode_IN;
GPIO_struct.GPIO_OType = GPIO_OType_PP;
GPIO_struct.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_struct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(BTN_GPIO_PORT, &GPIO_struct);
BSP_randomSeed(1234U);
if (!QS_INIT((void *)0)) { // initialize the QS software tracing
Q_ERROR();
}
}
//............................................................................
void BSP_displayPhilStat(uint8_t n, char const *stat) {
// exercise the FPU with some floating point computations
float volatile x;
x = 3.1415926F;
x = x + 2.7182818F;
if (stat[0] == 'h') {
LED_GPIO_PORT->BSRRL = LED3_PIN; // turn LED on
}
else {
LED_GPIO_PORT->BSRRH = LED3_PIN; // turn LED off
}
if (stat[0] == 'e') {
LED_GPIO_PORT->BSRRL = LED5_PIN; // turn LED on
}
else {
LED_GPIO_PORT->BSRRH = LED5_PIN; // turn LED on
}
(void)n; // unused parameter (in all but Spy build configuration)
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
QS_U8(1, n); // Philosopher number
QS_STR(stat); // Philosopher status
QS_END()
}
//............................................................................
void BSP_displayPaused(uint8_t paused) {
if (paused) {
LED_GPIO_PORT->BSRRL = LED4_PIN; // turn LED on
}
else {
LED_GPIO_PORT->BSRRH = LED4_PIN; // turn LED on
}
}
//............................................................................
uint32_t BSP_random(void) { // a very cheap pseudo-random-number generator
// "Super-Duper" Linear Congruential Generator (LCG)
// LCG(2^32, 3*7*11*13*23, 0, seed)
//
l_rnd = l_rnd * (3U*7U*11U*13U*23U);
return l_rnd >> 8;
}
//............................................................................
void BSP_randomSeed(uint32_t seed) {
l_rnd = seed;
}
//............................................................................
void BSP_terminate(int16_t result) {
(void)result;
}
} // namespace DPP
// namespace QP **************************************************************
namespace QP {
static TX_TIMER l_tick_timer; // ThreadX timer to call QF::tickX_()
#ifdef Q_SPY
// 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];
#endif
// QF callbacks ==============================================================
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_tickX_() directly from timer interrupts
// or from active object(s).
//
Q_ALLEGE(tx_timer_create(&l_tick_timer, // ThreadX timer object
"QF", // name of the timer
(VOID (*)(ULONG))&QP::QF::tickX_, // expiration function
0U, // expiration function input (tick rate)
1U, // initial ticks
1U, // reschedule ticks
TX_AUTO_ACTIVATE) // automatically activate timer
== 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
"QS", // thread name
&qs_thread_function, // thread function
(ULONG)0, // thread input (unsued)
qs_thread_stkSto, // stack start
sizeof(qs_thread_stkSto), // stack size in bytes
TX_MAX_PRIORITIES - 1, // ThreadX priority (lowest possible)
TX_MAX_PRIORITIES - 1, // preemption threshold disabled
TX_NO_TIME_SLICE,
TX_AUTO_START)
== TX_SUCCESS);
#endif // Q_SPY
}
//............................................................................
void QF::onCleanup(void) {
}
//............................................................................
extern "C" void Q_onAssert(char const *module, int loc) {
//
// NOTE: add here your application-specific error handling
//
(void)module;
(void)loc;
QS_ASSERTION(module, loc, static_cast<uint32_t>(10000U));
NVIC_SystemReset();
}
// QS callbacks ==============================================================
#ifdef Q_SPY
//............................................................................
static void qs_thread_function(ULONG /*thread_input*/) { // see NOTE1
for (;;) {
// turn the LED6 on an off to visualize the QS activity
LED_GPIO_PORT->BSRRL = LED6_PIN; // turn LED on
__NOP(); // wait a little to actually see the LED glow
__NOP();
__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 = QP::QS::getByte();
QF_CRIT_EXIT(intStat);
if (b != QP::QS_EOD) { // not End-Of-Data?
USART2->DR = (b & 0xFFU); // put into the DR register
}
}
// no blocking in this thread; see NOTE1
}
}
//............................................................................
bool QS::onStartup(void const *arg) {
static uint8_t qsBuf[1024]; // buffer for Quantum Spy
initBuf(qsBuf, sizeof(qsBuf));
GPIO_InitTypeDef GPIO_struct;
USART_InitTypeDef USART_struct;
// enable peripheral clock for USART2
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);
// GPIOA clock enable
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
// GPIOA Configuration: USART2 TX on PA2
GPIO_struct.GPIO_Pin = GPIO_Pin_2;
GPIO_struct.GPIO_Mode = GPIO_Mode_AF;
GPIO_struct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_struct.GPIO_OType = GPIO_OType_PP;
GPIO_struct.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOA, &GPIO_struct);
// Connect USART2 pins to AF2
GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_USART2); // TX = PA2
GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_USART2); // RX = PA3
USART_struct.USART_BaudRate = 115200;
USART_struct.USART_WordLength = USART_WordLength_8b;
USART_struct.USART_StopBits = USART_StopBits_1;
USART_struct.USART_Parity = USART_Parity_No;
USART_struct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_struct.USART_Mode = USART_Mode_Tx;
USART_Init(USART2, &USART_struct);
USART_Cmd(USART2, ENABLE); // enable USART2
// setup the QS filters...
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
QS_FILTER_ON(QS_QEP_STATE_EXIT);
QS_FILTER_ON(QS_QEP_STATE_INIT);
QS_FILTER_ON(QS_QEP_INIT_TRAN);
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
QS_FILTER_ON(QS_QEP_TRAN);
QS_FILTER_ON(QS_QEP_IGNORED);
QS_FILTER_ON(QS_QEP_DISPATCH);
QS_FILTER_ON(QS_QEP_UNHANDLED);
QS_FILTER_ON(DPP::PHILO_STAT);
return true; // return success
}
//............................................................................
void QS::onCleanup(void) {
}
//............................................................................
QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED
if ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0U) { // not set?
return DPP::QS_tickTime_ - static_cast<QSTimeCtr>(SysTick->VAL);
}
else { // the rollover occured, but the SysTick_ISR did not run yet
return DPP::QS_tickTime_ + DPP::QS_tickPeriod_
- static_cast<QSTimeCtr>(SysTick->VAL);
}
}
//............................................................................
void QS::onFlush(void) {
uint16_t b;
while ((b = getByte()) != QS_EOD) { // while not End-Of-Data...
while ((USART2->SR & USART_FLAG_TXE) == 0U) { // while TXE not empty
}
USART2->DR = (b & 0xFFU); // put into the DR register
}
}
//............................................................................
//! callback function to reset the target (to be implemented in the BSP)
void QS::onReset(void) {
//TBD
}
//............................................................................
//! callback function to execute a uesr command (to be implemented in BSP)
void QS::onCommand(uint8_t cmdId, uint32_t param) {
(void)cmdId;
(void)param;
//TBD
}
#endif // Q_SPY
//----------------------------------------------------------------------------
} // namespace QP
//****************************************************************************
// 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

@ -1,13 +1,13 @@
//////////////////////////////////////////////////////////////////////////////
// Product: DPP example for ThreadX
// Last updated for version 5.3.0
// Last updated on 2014-05-09
// Last updated for version 5.6.2
// Last updated on 2016-03-10
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
// 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
@ -28,20 +28,24 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Contact information:
// Web: www.state-machine.com
// Email: info@state-machine.com
// http://www.state-machine.com
// mailto:info@state-machine.com
//////////////////////////////////////////////////////////////////////////////
#ifndef bsp_h
#define bsp_h
#define BSP_TICKS_PER_SEC TX_TIMER_PERIODIC
namespace DPP {
void BSP_init(int argc, char *argv[]);
void BSP_displayPaused(uint8_t paused);
uint32_t const BSP_TICKS_PER_SEC = static_cast<uint32_t>(100);
void BSP_init(void);
void BSP_displayPaused(uint8_t const paused);
void BSP_displayPhilStat(uint8_t const n, char_t const *stat);
void BSP_terminate(int16_t const result);
void BSP_randomSeed(uint32_t const seed); // random seed
uint32_t BSP_random(void); // pseudo-random generator
} // namespace DPP
#endif // bsp_h

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\dpp.ewp</path>
</project>
<batchBuild/>
</workspace>

View File

@ -0,0 +1,31 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 512;
define symbol __ICFEDIT_size_heap__ = 0;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place at start of RAM_region {block CSTACK };
place in RAM_region { readwrite, block HEAP };

View File

@ -1,13 +1,13 @@
//////////////////////////////////////////////////////////////////////////////
// Product: DPP example
// Last updated for version 5.4.0
// Last updated on 2015-05-13
// Product: DPP example for ThreadX
// Last updated for version 5.6.2
// Last updated on 2016-03-10
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
// 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
@ -28,16 +28,16 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Contact information:
// Web: www.state-machine.com
// Email: info@state-machine.com
// http://www.state-machine.com
// mailto:info@state-machine.com
//////////////////////////////////////////////////////////////////////////////
#include "qp_port.h"
#include "dpp.h"
#include "bsp.h"
//............................................................................
int main(int argc, char *argv[]) {
BSP_init(argc, argv); // initialize the Board Support Package
int main() {
DPP::BSP_init(); // initialize the Board Support Package
tx_kernel_enter(); // transfet control to the ThreadX RTOS
return 0; // tx_kernel_enter() does not return
}

View File

@ -1,3 +0,0 @@
[InternetShortcut]
URL=http://www.state-machine.com/qpcpp/threadx_dpp_visual-studio.html
IconFile=http://www.state-machine.com/qp.ico

View File

@ -1,331 +0,0 @@
//////////////////////////////////////////////////////////////////////////////
// Product: DPP example for ThreadX
// Last Updated for Version: 5.6.0
// Date of the Last Update: 2015-12-26
//
// 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:
// http://www.state-machine.com
// mailto:info@state-machine.com
//////////////////////////////////////////////////////////////////////////////
#include "qp_port.h"
#include "dpp.h"
#include "bsp.h"
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
Q_DEFINE_THIS_FILE
// local variables -----------------------------------------------------------
static TX_TIMER l_tick_timer; // ThreadX timer to call QF::tickX_()
static unsigned l_rnd; // random seed
#ifdef Q_SPY
enum QSUserRecords {
PHILO_STAT = QP::QS_USER
};
// 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];
#endif // Q_SPY
//............................................................................
void BSP_init(int argc, char *argv[]) {
char const *hostAndPort = "localhost:6601";
printf("Dining Philosopher Problem example"
"\nQEP %s\nQF %s\n"
"Press Ctrl-C to quit...\n",
QP::QEP::getVersion(),
QP::QF::getVersion());
BSP_randomSeed(1234U); // seed the random number generator
if (argc > 1) { // port specified?
hostAndPort = argv[1];
}
if (!QS_INIT(hostAndPort)) {
printf("\nUnable to open QSpy socket\n");
exit(-1);
}
}
//............................................................................
void BSP_terminate(int16_t result) {
(void)result;
}
//............................................................................
void BSP_displayPhilStat(uint8_t const n, char_t const *stat) {
printf("Philosopher %2d is %s\n", (int)n, stat);
QS_BEGIN(PHILO_STAT, DPP::AO_Philo[n]) // application-specific record begin
QS_U8(1, n); // Philosopher number
QS_STR(stat); // Philosopher status
QS_END()
}
//............................................................................
void BSP_displayPaused(uint8_t paused) {
printf("PAUSED\n");
}
//............................................................................
uint32_t BSP_random(void) { // a very cheap pseudo-random-number generator
// "Super-Duper" Linear Congruential Generator (LCG)
// LCG(2^32, 3*7*11*13*23, 0, seed)
//
l_rnd = l_rnd * (3U*7U*11U*13U*23U);
return l_rnd >> 8;
}
//............................................................................
void BSP_randomSeed(uint32_t seed) {
l_rnd = seed;
}
//............................................................................
void QP::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_tickX_() directly from timer interrupts
// or from active object(s).
//
Q_ALLEGE(tx_timer_create(&l_tick_timer, // ThreadX timer object
"QF", // name of the timer
(VOID (*)(ULONG))&QP::QF::tickX_, // expiration function
0U, // expiration function input (tick rate)
1U, // initial ticks
1U, // reschedule ticks
TX_AUTO_ACTIVATE) // automatically activate timer
== 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
"QS", // thread name
&qs_thread_function, // thread function
(ULONG)0, // thread input (unsued)
qs_thread_stkSto, // stack start
sizeof(qs_thread_stkSto), // stack size in bytes
TX_MAX_PRIORITIES - 1, // ThreadX priority (lowest possible)
TX_MAX_PRIORITIES - 1, // preemption threshold disabled
TX_NO_TIME_SLICE,
TX_AUTO_START)
== TX_SUCCESS);
#endif // Q_SPY
}
//............................................................................
void QP::QF::onCleanup(void) {
tx_timer_deactivate(&l_tick_timer);
QS_EXIT();
exit(0);
}
//............................................................................
extern "C" void Q_onAssert(char const * const module, int loc) {
QS_ASSERTION(module, loc, 10000U); // report assertion to QS
fprintf(stderr, "Assertion failed in %s, location %d", module, loc);
QP::QF::stop();
}
//----------------------------------------------------------------------------
#ifdef Q_SPY // define QS callbacks
//
// In this demo, the QS software tracing output is sent out of the application
// through a TCP/IP socket. This requires the QSPY host application to
// be started first to open a server socket (qspy -t ...) to wait for the
// incoming TCP/IP connection from the DPP demo.
//
// In an embedded target, the QS software tracing output can be sent out
// using any method available, such as a UART. This would require changing
// the implementation of the functions in this section, but the rest of the
// application code does not "know" (and should not care) how the QS ouptut
// is actually performed. In other words, the rest of the application does NOT
// need to change in any way to produce QS output.
//
static SOCKET l_sock = INVALID_SOCKET;
//............................................................................
static void qs_thread_function(ULONG thread_input) { // see NOTE1
(void)thread_input;
for (;;) {
uint16_t nBytes = 1024U;
uint8_t const *block;
QF_CRIT_STAT_TYPE int_posture;
QF_CRIT_ENTRY(int_posture);
block = QP::QS::getBlock(&nBytes);
QF_CRIT_EXIT(int_posture);
if (block != (uint8_t *)0) {
send(l_sock, (char const *)block, nBytes, 0);
}
tx_thread_sleep(1U); // sleep for a tick
}
}
//............................................................................
bool QP::QS::onStartup(void const *arg) {
static uint8_t qsBuf[1024]; // 1K buffer for Quantum Spy
static WSADATA wsaData;
char host[64];
char const *src;
char *dst;
USHORT port = 6601; // default port
ULONG ioctl_opt = 1;
struct sockaddr_in servAddr;
struct hostent *server;
initBuf(qsBuf, sizeof(qsBuf));
// initialize Windows sockets
if (WSAStartup(MAKEWORD(2,0), &wsaData) == SOCKET_ERROR) {
printf("Windows Sockets cannot be initialized.");
return (uint8_t)0;
}
src = (char const *)arg;
dst = host;
while ((*src != '\0') && (*src != ':') && (dst < &host[sizeof(host)])) {
*dst++ = *src++;
}
*dst = '\0';
if (*src == ':') {
port = (USHORT)strtoul(src + 1, NULL, 10);
}
l_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // TCP socket
if (l_sock == INVALID_SOCKET){
printf("Socket cannot be created.\n"
"Windows socket error 0x%08X.",
WSAGetLastError());
return (uint8_t)0;
}
server = gethostbyname(host);
if (server == NULL) {
printf("QSpy host name cannot be resolved.\n"
"Windows socket error 0x%08X.",
WSAGetLastError());
return (uint8_t)0;
}
memset(&servAddr, 0, sizeof(servAddr));
servAddr.sin_family = AF_INET;
memcpy(&servAddr.sin_addr, server->h_addr, server->h_length);
servAddr.sin_port = htons(port);
if (connect(l_sock, (struct sockaddr *)&servAddr, sizeof(servAddr))
== SOCKET_ERROR)
{
printf("Socket cannot be connected to the QSpy server.\n"
"Windows socket error 0x%08X.",
WSAGetLastError());
QS_EXIT();
return (uint8_t)0;
}
// Set the socket to non-blocking mode
if (ioctlsocket(l_sock, FIONBIO, &ioctl_opt) == SOCKET_ERROR) {
printf("Socket configuration failed.\n"
"Windows socket error 0x%08X.",
WSAGetLastError());
QS_EXIT();
return (uint8_t)0;
}
// set up the QS filters...
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
QS_FILTER_ON(QS_QEP_STATE_EXIT);
QS_FILTER_ON(QS_QEP_STATE_INIT);
QS_FILTER_ON(QS_QEP_INIT_TRAN);
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
QS_FILTER_ON(QS_QEP_TRAN);
QS_FILTER_ON(QS_QEP_IGNORED);
QS_FILTER_ON(QS_QEP_DISPATCH);
QS_FILTER_ON(QS_QEP_UNHANDLED);
QS_FILTER_ON(QS_QF_ACTIVE_POST_FIFO);
QS_FILTER_ON(QS_QF_ACTIVE_POST_LIFO);
QS_FILTER_ON(QS_QF_PUBLISH);
QS_FILTER_ON(PHILO_STAT);
return true; // success
}
//............................................................................
void QP::QS::onCleanup(void) {
if (l_sock != INVALID_SOCKET) {
closesocket(l_sock);
}
WSACleanup();
}
//............................................................................
QP::QSTimeCtr QP::QS::onGetTime(void) {
return static_cast<QP::QSTimeCtr>(clock());
}
//............................................................................
void QP::QS::onFlush(void) {
uint16_t nBytes = 1000;
uint8_t const *block;
while ((block = getBlock(&nBytes)) != (uint8_t *)0) {
send(l_sock, (char const *)block, nBytes, 0);
nBytes = 1000;
}
}
//............................................................................
//! callback function to reset the target (to be implemented in the BSP)
void QS::onReset(void) {
//TBD
}
//............................................................................
//! callback function to execute a uesr command (to be implemented in BSP)
void QS::onCommand(uint8_t cmdId, uint32_t param) {
(void)cmdId;
(void)param;
//TBD
}
#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.
//

View File

@ -1,23 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dpp", "dpp.vcxproj", "{A39458B1-692F-4877-A171-4B03B634C6CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Spy|Win32 = Spy|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A39458B1-692F-4877-A171-4B03B634C6CE}.Debug|Win32.ActiveCfg = Debug|Win32
{A39458B1-692F-4877-A171-4B03B634C6CE}.Debug|Win32.Build.0 = Debug|Win32
{A39458B1-692F-4877-A171-4B03B634C6CE}.Release|Win32.ActiveCfg = Release|Win32
{A39458B1-692F-4877-A171-4B03B634C6CE}.Release|Win32.Build.0 = Release|Win32
{A39458B1-692F-4877-A171-4B03B634C6CE}.Spy|Win32.ActiveCfg = Spy|Win32
{A39458B1-692F-4877-A171-4B03B634C6CE}.Spy|Win32.Build.0 = Spy|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,261 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.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="Spy|Win32">
<Configuration>Spy</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A39458B1-692F-4877-A171-4B03B634C6CE}</ProjectGuid>
<RootNamespace>dpp</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Spy|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Spy|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>
<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>
<_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Spy|Win32'">
<OutDir>.\Spy\</OutDir>
<IntDir>.\Spy\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/dpp.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;../../../include;../../../source;../../../ports/threadx;../../../3rd_party/threadx/visual-studio;$(THREADX)/visual_studio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/dpp.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/dpp.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/dpp.bsc</OutputFile>
</Bscmake>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/dpp.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>.;../../../include;../../../source;../../../ports/threadx;../../../3rd_party/threadx/visual-studio;$(THREADX)/visual_studio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/dpp.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(QPC)/ports/threadx/visual_studio/Release;$(THREADX)/visual_studio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>.\Release/dpp.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/dpp.bsc</OutputFile>
</Bscmake>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Spy|Win32'">
<Midl>
<TypeLibraryName>.\Spy/dpp.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;../../../include;../../../source;../../../ports/threadx;../../../3rd_party/threadx/visual-studio;$(THREADX)/visual_studio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>Q_SPY;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Spy/dpp.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Spy/</AssemblerListingLocation>
<ObjectFileName>.\Spy/</ObjectFileName>
<ProgramDataBaseFileName>.\Spy/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>$(QPC)/ports/threadx/visual_studio/Spy;$(THREADX)/visual_studio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Spy/dpp.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Spy/dpp.bsc</OutputFile>
</Bscmake>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\include\qstamp.cpp" />
<ClCompile Include="..\..\..\ports\threadx\qf_port.cpp" />
<ClCompile Include="..\..\..\source\qep_hsm.cpp" />
<ClCompile Include="..\..\..\source\qep_msm.cpp" />
<ClCompile Include="..\..\..\source\qf_act.cpp" />
<ClCompile Include="..\..\..\source\qf_defer.cpp" />
<ClCompile Include="..\..\..\source\qf_dyn.cpp" />
<ClCompile Include="..\..\..\source\qf_ps.cpp" />
<ClCompile Include="..\..\..\source\qf_qact.cpp" />
<ClCompile Include="..\..\..\source\qf_qeq.cpp" />
<ClCompile Include="..\..\..\source\qf_qmact.cpp" />
<ClCompile Include="..\..\..\source\qf_time.cpp" />
<ClCompile Include="..\..\..\source\qs.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_64bit.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_fp.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_rx.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Spy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="bsp.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="philo.cpp" />
<ClCompile Include="table.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\ports\threadx\qep_port.h" />
<ClInclude Include="..\..\..\ports\threadx\qf_port.h" />
<ClInclude Include="..\..\..\ports\threadx\qs_port.h" />
<ClInclude Include="..\..\..\source\qf_pkg.h" />
<ClInclude Include="..\..\..\source\qs_pkg.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="bsp.h" />
<ClInclude Include="dpp.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\..\..\3rd_party\threadx\visual-studio\tx.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="bsp.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="philo.cpp" />
<ClCompile Include="table.cpp" />
<ClCompile Include="..\..\..\source\qep_hsm.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qep_msm.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_act.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_defer.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_dyn.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_ps.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_qact.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_qeq.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_qmact.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qf_time.cpp">
<Filter>QP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\ports\threadx\qf_port.cpp">
<Filter>QP_port</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qs.cpp">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_64bit.cpp">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_fp.cpp">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\qs_rx.cpp">
<Filter>QS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\include\qstamp.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bsp.h" />
<ClInclude Include="dpp.h" />
<ClInclude Include="..\..\..\source\qs_pkg.h">
<Filter>QS</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>
<ClInclude Include="..\..\..\source\qf_pkg.h">
<Filter>QP</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="ThreadX">
<UniqueIdentifier>{b300da43-287f-4076-98e8-e31b52a37ed8}</UniqueIdentifier>
</Filter>
<Filter Include="QS">
<UniqueIdentifier>{846bb110-0fc4-414c-a836-22dda7de0597}</UniqueIdentifier>
</Filter>
<Filter Include="QP_port">
<UniqueIdentifier>{1f1ee7fa-e32d-4b60-a91c-d04e33ed1aa7}</UniqueIdentifier>
</Filter>
<Filter Include="QP">
<UniqueIdentifier>{33fb9d05-f9cd-4205-8b40-a609275cd2cc}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Library Include="..\..\..\3rd_party\threadx\visual-studio\tx.lib">
<Filter>ThreadX</Filter>
</Library>
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@
* by the application.
*
* Quantum Leaps, LLC. www.state-machine.com
* 2015-03-22
* 2016-03-31
*===========================================================================*/
/*
*********************************************************************************************************
@ -59,7 +59,7 @@
#define OS_MAX_QS 20u /* Max. number of queue control blocks in your application */
#define OS_MAX_TASKS 20u /* Max. number of tasks in your application, MUST be >= 2 */
#define OS_SCHED_LOCK_EN 0u /* Include code for OSSchedLock() and OSSchedUnlock() */
#define OS_SCHED_LOCK_EN 1u /* Include code for OSSchedLock() and OSSchedUnlock() */
#define OS_TICK_STEP_EN 1u /* Enable tick stepping feature for uC/OS-View */
#define OS_TICKS_PER_SEC 100u /* Set the number of ticks in one second */

View File

@ -10,7 +10,7 @@
* by the application.
*
* Quantum Leaps, LLC. www.state-machine.com
* 2015-03-22
* 2016-03-31
*===========================================================================*/
/*
*********************************************************************************************************
@ -59,7 +59,7 @@
#define OS_MAX_QS 20u /* Max. number of queue control blocks in your application */
#define OS_MAX_TASKS 20u /* Max. number of tasks in your application, MUST be >= 2 */
#define OS_SCHED_LOCK_EN 0u /* Include code for OSSchedLock() and OSSchedUnlock() */
#define OS_SCHED_LOCK_EN 1u /* Include code for OSSchedLock() and OSSchedUnlock() */
#define OS_TICK_STEP_EN 1u /* Enable tick stepping feature for uC/OS-View */
#define OS_TICKS_PER_SEC 100u /* Set the number of ticks in one second */

View File

@ -1,20 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_threadx", "demo_threadx\demo_threadx.vcxproj", "{E909B566-818F-4E21-ADEC-7890514BB7AD}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qhsmtst", "qhsmtst.vcxproj", "{8CC465F7-872E-4D03-B93C-1B64858B4E11}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
QSpy|Win32 = QSpy|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E909B566-818F-4E21-ADEC-7890514BB7AD}.Debug|Win32.ActiveCfg = Debug|Win32
{E909B566-818F-4E21-ADEC-7890514BB7AD}.Debug|Win32.Build.0 = Debug|Win32
{E909B566-818F-4E21-ADEC-7890514BB7AD}.Release|Win32.ActiveCfg = Release|Win32
{E909B566-818F-4E21-ADEC-7890514BB7AD}.Release|Win32.Build.0 = Release|Win32
{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}.Release|Win32.ActiveCfg = Release|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.Release|Win32.Build.0 = Release|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|Win32.ActiveCfg = QSpy|Win32
{8CC465F7-872E-4D03-B93C-1B64858B4E11}.QSpy|Win32.Build.0 = QSpy|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.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="QSpy|Win32">
<Configuration>QSpy</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8CC465F7-872E-4D03-B93C-1B64858B4E11}</ProjectGuid>
<RootNamespace>qhsmtst</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='QSpy|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v120</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)'=='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)'=='Debug|Win32'" 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>
<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>
<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>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;../../../include;../../../ports/win32;%(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>qp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../../../ports/win32/$(Configuration);%(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)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>.;../../../include;../../../ports/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;snprintf=_snprintf;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>qp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../../../ports/win32/$(Configuration);%(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)'=='QSpy|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;../../../include;../../../ports/win32;$(QTOOLS)/qspy/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>Q_SPY;snprintf=_snprintf;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>qp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../../../ports/win32/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>cmd /c "del $(OutDir)qstamp.obj"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(QTOOLS)\qspy\source\qspy.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\include\qstamp.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="qhsmtst.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="qhsmtst.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="$(QTOOLS)\qspy\source\qspy.c">
<Filter>QSPY</Filter>
</ClCompile>
<ClCompile Include="..\..\..\include\qstamp.cpp" />
<ClCompile Include="qhsmtst.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="qhsmtst.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="QSPY">
<UniqueIdentifier>{e71349b5-55dc-4b60-b27b-62172fe84f0c}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -3,8 +3,8 @@
/// @ingroup qep
/// @cond
///***************************************************************************
/// Last updated for version 5.6.1
/// Last updated on 2015-12-30
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -43,15 +43,15 @@
//! The current QP version as a decimal constant XYZ, where X is a 1-digit
// major version number, Y is a 1-digit minor version number, and Z is
// a 1-digit release number.
#define QP_VERSION 561
#define QP_VERSION 562
//! The current QP version number string of the form X.Y.Z, where X is
// a 1-digit major version number, Y is a 1-digit minor version number,
// and Z is a 1-digit release number.
#define QP_VERSION_STR "5.6.1"
#define QP_VERSION_STR "5.6.2"
//! Tamperproof current QP release (5.6.1) and date (16-01-01)
#define QP_RELEASE 0xA092847EU
//! Tamperproof current QP release (5.6.2) and date (16-03-31)
#define QP_RELEASE 0xA06F6C1DU
#ifndef Q_SIGNAL_SIZE
//! The size (in bytes) of the signal of an event. Valid values:

View File

@ -4,7 +4,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 5.6.2
/// Last updated on 2016-02-10
/// Last updated on 2016-03-30
///
/// Q u a n t u m L e a P s
/// ---------------------------

View File

@ -3,14 +3,14 @@
/// @ingroup qk
/// @cond
///***************************************************************************
/// Last updated for version 5.6.0
/// Last updated on 2015-12-26
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps. All rights reserved.
/// 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
@ -102,16 +102,18 @@ public:
static void onIdle(void);
};
/*! Priority Ceiling Mutex the QK preemptive kernel */
/*! Priority-ceiling Mutex the QK preemptive kernel */
class QMutex {
public:
void init(uint_fast8_t const prioCeiling);
void init(uint_fast8_t const prio);
void lock(void);
void unlock(void);
private:
uint_fast8_t m_prioCeiling;
uint_fast8_t m_lockNest;
uint_fast8_t m_lockPrio; //!< lock prio (priority ceiling)
uint_fast8_t m_prevPrio; //!< previoius lock prio
friend class QF;
};
} // namespace QP
@ -135,6 +137,7 @@ uint_fast8_t QK_schedPrio_(void);
#endif
extern uint_fast8_t volatile QK_currPrio_; //!< current task/ISR priority
extern uint_fast8_t volatile QK_lockPrio_; //!< lock prio (0 == no-lock)
#ifndef QK_ISR_CONTEXT_
extern uint_fast8_t volatile QK_intNest_; //!< interrupt nesting level
@ -155,6 +158,25 @@ extern uint_fast8_t volatile QK_currPrio_; //!< current task/ISR priority
(QK_intNest_ != static_cast<uint_fast8_t>(0))
#endif // QK_ISR_CONTEXT_
// QF-specific scheduler locking
//! Internal port-specific macro to represent the scheduler lock status
// that needs to be preserved to allow nesting of locks.
#define QF_SCHED_STAT_TYPE_ QMutex
//! Internal port-specific macro for selective scheduler locking.
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (QK_ISR_CONTEXT_()) { \
(pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->init((prio_)); \
(pLockStat_)->lock(); \
} \
} while (false)
//! Internal port-specific macro for selective scheduler unlocking.
#define QF_SCHED_UNLOCK_(pLockStat_) (pLockStat_)->unlock()
// native event queue operations...
#define QACTIVE_EQUEUE_WAIT_(me_) \
Q_ASSERT_ID(0, (me_)->m_eQueue.m_frontEvt != static_cast<QEvt *>(0))

View File

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// Product: PC-Lint 9.x option file for linting QP/C++ applications
// Last updated for version 5.6.0
// Last updated on 2015-12-26
// Last updated for version 5.6.2
// Last updated on 2016-04-01
//
// Q u a n t u m L e a P s
// ---------------------------
@ -276,6 +276,18 @@
QK_ceilingPrio_)
// QXK
-estring(1960, // 11-0-1(req) non-private data member
curr,
next,
lockPrio,
lockHolder,
readySet)
-esym(1712, // default constructor not defined
QXThread)
-esym(1960, signal) // 17-0-2, Re-use of C++ identifier
// QS
-emacro(506, QS_*) // 0-1-1 constant value boolean
-emacro(774, QS_*) // 0-1-1 'if' always True

View File

@ -3,14 +3,14 @@
/// @ingroup qs
/// @cond
///***************************************************************************
/// Last updated for version 5.6.0
/// Last updated on 2015-12-26
/// Last updated for version 5.6.2
/// Last updated on 2016-03-30
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps. All rights reserved.
/// 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
@ -129,16 +129,16 @@ enum QSpyRecords {
QS_QF_RESERVED0,
// [50] QK/QV records
QS_QK_MUTEX_LOCK, //!< QK mutex was locked
QS_QK_MUTEX_UNLOCK, //!< QK mutex was unlocked
QS_QVK_SCHEDULE, //!< QK/QV scheduled a new task to execute
QS_QVK_IDLE, //!< QK/QV became idle
QS_QK_RESUME, //!< QK resumed previous task (not idle)
QS_SCHED_LOCK, //!< scheduler was locked
QS_SCHED_UNLOCK, //!< scheduler was unlocked
QS_SCHED_NEXT, //!< scheduler found next task to execute
QS_SCHED_IDLE, //!< scheduler became idle
QS_SCHED_RESUME, //!< scheduler resumed previous task (not idle)
// [55] Additional QEP records
QS_QEP_TRAN_HIST, //!< a transition to history was taken
QS_QEP_TRAN_EP, //!< a tran. to entry point into a submachine
QS_QEP_TRAN_XP, //!< a tran. to exit point out of a submachine
QS_QEP_TRAN_HIST, //!< a tran to history was taken
QS_QEP_TRAN_EP, //!< a tran to entry point into a submachine
QS_QEP_TRAN_XP, //!< a tran to exit point out of a submachine
QS_QEP_RESERVED1,
QS_QEP_RESERVED0,

View File

@ -3,14 +3,14 @@
/// @ingroup qv
/// @cond
///***************************************************************************
/// Last updated for version 5.6.0
/// Last updated on 2015-12-26
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps. All rights reserved.
/// 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
@ -105,6 +105,12 @@ extern "C" {
#ifdef QP_IMPL
// QF-specific scheduler locking (not needed in QV)
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, dummy) ((pLockStat_)->m_lockPrio \
= static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)
// native event queue operations...
#define QACTIVE_EQUEUE_WAIT_(me_) \
Q_ASSERT((me_)->m_eQueue.m_frontEvt != static_cast<QEvt const *>(0))

View File

@ -4,14 +4,14 @@
/// @ingroup qxk
/// @cond
///***************************************************************************
/// Last updated for version 5.6.0
/// Last updated on 2015-12-29
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps. All rights reserved.
/// 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
@ -73,6 +73,8 @@ extern "C" {
struct QXK_Attr {
void *curr; //!< currently executing thread
void *next; //!< next thread to execute
uint_fast8_t volatile lockPrio; //!< lock prio (0 == no-lock)
uint_fast8_t volatile lockHolder; //!< prio of the lock holder
#ifndef QXK_ISR_CONTEXT_
uint_fast8_t volatile intNest; //!< ISR nesting level
#endif // QXK_ISR_CONTEXT_
@ -95,7 +97,7 @@ namespace QP {
//! Type of the QMActive.m_thread member for the QXK kernel
struct QXK_ThreadType {
void *m_stack; //!< top of the per-thread stack
uint_fast8_t m_startPrio; //!< start priority of the thread
// ... possibly other thread attributes in the future
};
//****************************************************************************
@ -116,7 +118,8 @@ public:
/// @description
/// QP::QXK::init() must be called from the application before
/// QP::QF::run() to initialize the stack for the QXK idle thread.
static void init(void *idleStkSto, uint_fast16_t idleStkSize);
static void init(void * const idleStkSto,
uint_fast16_t const idleStkSize);
//! QXK idle callback (customized in BSPs for QXK)
/// @description
@ -142,7 +145,7 @@ class QXMutex {
public:
//! initialize the QXK priority-ceiling mutex
void init(uint_fast8_t const prioCeiling);
void init(uint_fast8_t const prio);
//! lock the QXK priority-ceiling mutex
void lock(void);
@ -151,13 +154,11 @@ public:
void unlock(void);
private:
uint_fast8_t m_prioCeiling;
uint_fast8_t m_lockNest;
#if (QF_MAX_ACTIVE <= 8)
QP::QPSet8 m_waitSet; //!< set of "naked" threads waiting on this mutex
#else
QP::QPSet64 m_waitSet; //!< set of "naked" threads waiting on this mutex
#endif
uint_fast8_t m_lockPrio; //!< lock prio (priority ceiling)
uint_fast8_t m_prevPrio; //!< previoius lock prio
uint_fast8_t m_prevHolder; //!< priority of the thread holding the lock
friend class QF;
};
} // namespace QP
@ -185,6 +186,19 @@ void QXK_sched_(void);
(QXK_attr_.intNest != static_cast<uint_fast8_t>(0))
#endif // QXK_ISR_CONTEXT_
// QF-specific scheduler locking
#define QF_SCHED_STAT_TYPE_ QXMutex
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (QXK_ISR_CONTEXT_()) { \
(pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->init((prio_)); \
(pLockStat_)->lock(); \
} \
} while (0)
#define QF_SCHED_UNLOCK_(pLockStat_) (pLockStat_)->unlock()
#define QACTIVE_EQUEUE_WAIT_(me_) \
if ((me_)->m_eQueue.m_frontEvt == static_cast<QEvt *>(0)) { \
QXK_attr_.readySet.remove((me_)->m_prio); \

View File

@ -41,6 +41,9 @@
namespace QP {
//! Thread handler pointer-to-function
typedef void (*QXThreadHandler)(void * const par);
//****************************************************************************
//! Extended (blocking) thread of the QXK preemptive kernel
/// @description
@ -62,8 +65,6 @@ namespace QP {
///
class QXThread : public QMActive {
public:
//! Thread handler pointer-to-function
typedef void (*QXThreadHandler)(void *par);
//! public constructor
QXThread(QXThreadHandler const handler, uint_fast8_t const tickRate);

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to embOS (v4.00) kernel, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.4.0
/// Last updated on 2015-05-08
/// Last updated for version 5.6.2
/// Last updated on 2016-03-09
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
////**************************************************************************
/// @endcond
@ -174,12 +174,14 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// posting to the embOS mailbox must succeed, see NOTE3
Q_ALLEGE_ID(710,
OS_PutMailCond(&m_eQueue, static_cast<OS_CONST_PTR void *>(&e))
== static_cast<char>(0));
status = true; // return success
status = true; // report success
}
else {
// can tolerate dropping evts?
@ -196,10 +198,11 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_EQC_(static_cast<QEQueueCtr>(0)); // min # free (unknown)
QS_END_NOCRIT_()
status = false; // return failure
}
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;
}
//............................................................................
@ -221,12 +224,12 @@ void QMActive::postLIFO(QEvt const * const e) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// posting to the embOS mailbox must succeed, see NOTE3
Q_ALLEGE_ID(810,
OS_PutMailFrontCond(&m_eQueue, static_cast<OS_CONST_PTR void *>(&e))
== static_cast<char>(0));
QF_CRIT_EXIT_();
}
//............................................................................
QEvt const *QMActive::get_(void) {

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to embOS (v4.00) kernel, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 5.4.0
/// Last updated on 2015-05-11
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
@ -79,6 +79,19 @@ void QF_setEmbOsTaskAttr(QMActive *act, uint32_t attr);
//
#ifdef QP_IMPL
// embOS-specific scheduler locking, see NOTE3
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (OS_InInt != (OS_U8)0) { \
(pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->m_lockPrio = (prio_); \
OS_EnterRegion(); \
} \
} while (0)
#define QF_SCHED_UNLOCK_(dummy) OS_LeaveRegion()
// native QF event pool operations...
#define QF_EPOOL_TYPE_ QMPool
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
@ -104,5 +117,10 @@ void QF_setEmbOsTaskAttr(QMActive *act, uint32_t attr);
// critical section to nest. Nesting of critical sections is needed in this
// QP-embOS port.
//
// NOTE3:
// embOS provides only global scheduler locking for all thread priorities
// by means of OS_EnterRegion() and OS_LeaveRegion(). Therefore, locking the
// scheduler only up to the specified lock priority is not supported.
//
#endif // qf_port_h

View File

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// Product: PC-Lint 9.x option file for linting QP/C++
// Last updated for version 5.5.0
// Last updated on 2015-09-25
// Last updated for version 5.6.2
// Last updated on 2016-03-31
//
// Q u a n t u m L e a P s
// ---------------------------
@ -101,10 +101,16 @@ qpcpp.lnt // QP/C++ options
QF_EVT_REF_CTR_,
QF_CRIT_ENTRY_,
QF_CRIT_EXIT_,
QF_SCHED_LOCK_,
QF_SCHED_UNLOCK_,
QF_PTR_AT_,
QF_PTR_RANGE_,
QF_PTR_INC_,
QF_QACTIVE_TO_QHSM_CAST_)
-esym(1923,
QF_SCHED_STAT_TYPE_, // 16-2-2 Macro could become const variable
QF_SCHED_LOCK_,
QF_SCHED_UNLOCK_)
-emacro(740, // 5-2-7 Unusual pointer cast (incompatible indirect types)
QF_QACTIVE_TO_QHSM_CAST_)
-efunc(818, // 7-1-2 'stkSto' could be const
@ -121,13 +127,14 @@ qpcpp.lnt // QP/C++ options
-esym(1960, QP::QF_*) // 3-2-3, object/function previously declared
// reported incorrectly for qf_pkg.h
// QV/QK
// QV/QK/QXK
-emacro(925, // 5-2-8, 5-2-9 cast from pointer to pointer
QK_TLS)
-esym(1960, // 16-0-4 function-like macro
QK_ISR_CONTEXT_)
-efunc(527, *QF::run) // 0-1-1 Unreachable code
-esym(1923,
QACTIVE_EQUEUE_ONEMPTY_) // 16-2-2 Macro could become const variable
// QS -- the following options are needed only when Q_SPY is defined

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to POSIX/P-threads
/// @cond
///***************************************************************************
/// Last updated for version 5.4.0
/// Last updated on 2015-04-14
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
@ -86,6 +86,13 @@ extern pthread_mutex_t QF_pThreadMutex_; // mutex for QF critical section
//
#ifdef QP_IMPL
// POSIX-specific scheduler locking (not used at this point)
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)
// native QF event queue operations...
#define QACTIVE_EQUEUE_WAIT_(me_) \
while ((me_)->m_eQueue.m_frontEvt == static_cast<QEvt const *>(0)) \

View File

@ -2,8 +2,8 @@
/// @brief QP/C++ port to Qt
/// @cond
///***************************************************************************
/// Last Updated for Version: QP 5.5.0/Qt 5.x
/// Last updated on 2015-09-27
/// Last Updated for Version: QP 5.6.2/Qt 5.x
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -105,6 +105,14 @@ void QS_onEvent(void);
// interface used only inside QF, but not in applications
#ifdef QP_IMPL
// Qt-specific scheduler locking (not used at this point)
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)
// Qt-specific event queue customization
#define QACTIVE_EQUEUE_WAIT_(me_) \
while ((me_)->m_eQueue.m_frontEvt == static_cast<QEvt const *>(0)) \

View File

@ -1,36 +1,40 @@
//////////////////////////////////////////////////////////////////////////////
// Product: QF/C++ port to ThreadX
// Last updated for version 5.4.0
// Last updated on 2015-05-13
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
//
// 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:
// Web: www.state-machine.com
// Email: info@state-machine.com
//////////////////////////////////////////////////////////////////////////////
/// @file
/// @brief QF/C++ port to ThreadX, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// 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:
/// http://www.state-machine.com
/// mailto:info@state-machine.com
////**************************************************************************
/// @endcond
#define QP_IMPL // this is QP implementation
#include "qf_port.h" // QF port
#include "qf_pkg.h"
@ -70,8 +74,17 @@ void QF::thread_(QMActive *act) {
act->dispatch(e); // dispatch to the active object's state machine
gc(e); // check if the event is garbage, and collect it if so
}
act->unsubscribeAll();
Q_ALLEGE(tx_queue_delete(&act->m_eQueue) == TX_SUCCESS); // cleanup queue
act->unsubscribeAll(); // unsubscribe from all events
QF::remove_(act); // remove this active object from QF
// cleanup of the queue and thread must succeed
Q_ALLEGE_ID(110, tx_queue_delete(&act->m_eQueue) == TX_SUCCESS);
Q_ALLEGE_ID(120, tx_thread_delete(&act->getThread()) == TX_SUCCESS);
}
//............................................................................
static void thread_function(ULONG thread_input) { // ThreadX signature
// run the active-object thread
QF::thread_(reinterpret_cast<QMActive *>(thread_input));
}
//............................................................................
void QMActive::start(uint_fast8_t prio,
@ -102,7 +115,7 @@ void QMActive::start(uint_fast8_t prio,
&m_thread, // ThreadX thread control block
"AO", // thread name
&thread_function, // thread function
reinterpret_cast<ULONG>(this), // thread input
reinterpret_cast<ULONG>(this), // thread argument
stkSto, // stack start
stkSize, // stack size in bytes
tx_prio, // ThreadX priority
@ -110,17 +123,6 @@ void QMActive::start(uint_fast8_t prio,
TX_NO_TIME_SLICE,
TX_AUTO_START)
== TX_SUCCESS);
m_osObject = true; // indicate that the thread is running
}
//............................................................................
static void thread_function(ULONG thread_input) { // ThreadX signature
QMActive *act = reinterpret_cast<QMActive *>(thread_input);
QF::thread_(act);
QF::remove_(act);
Q_ALLEGE_ID(310,
tx_thread_delete(&act->getThread()) == TX_SUCCESS); // cleanup thread
}
//............................................................................
void QMActive::stop(void) {
@ -157,11 +159,14 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
QEvt const *ep = const_cast<QEvt const *>(e);
Q_ALLEGE_ID(510,
tx_queue_send(&m_eQueue, static_cast<VOID *>(&ep), TX_NO_WAIT)
== TX_SUCCESS);
status = true;
status = true; // report success
}
else {
// can tolerate dropping evts?
@ -179,10 +184,11 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_EQC_(static_cast<QEQueueCtr>(0)); // min # free (unknown)
QS_END_NOCRIT_()
status = false; // return failure
}
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;
}
//............................................................................
@ -205,12 +211,13 @@ void QMActive::postLIFO(QEvt const * const e) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// LIFO posting must succeed, see NOTE1
QEvt const *ep = const_cast<QEvt const *>(e);
Q_ALLEGE_ID(610,
tx_queue_front_send(&m_eQueue, static_cast<VOID *>(&ep), TX_NO_WAIT)
== TX_SUCCESS);
QF_CRIT_EXIT_();
}
//............................................................................
QEvt const *QMActive::get_(void) {
@ -232,4 +239,48 @@ QEvt const *QMActive::get_(void) {
return e;
}
//............................................................................
void QFSchedLock::lock(uint_fast8_t prio) {
QS_CRIT_STAT_
m_lockHolder = tx_thread_identify();
/// @pre must be thread level, so current TX thread must be available
Q_REQUIRE_ID(700, m_lockHolder != static_cast<TX_THREAD *>(0));
// change the preemption threshold of the current thread
Q_ALLEGE_ID(710, tx_thread_preemption_change(m_lockHolder,
(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE - prio),
&m_prevThre) == TX_SUCCESS);
m_lockPrio = prio;
QS_BEGIN_(QS_SCHED_LOCK, static_cast<void *>(0), static_cast<void *>(0))
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE
- m_prevThre),
static_cast<uint8_t>(m_lockPrio)); // new lock prio
QS_END_()
}
//............................................................................
void QFSchedLock::unlock(void) const {
QS_CRIT_STAT_
/// @pre the lock holder TX thread must be available */
Q_REQUIRE_ID(800, m_lockHolder != static_cast<TX_THREAD *>(0));
QS_BEGIN_(QS_SCHED_UNLOCK,
static_cast<void *>(0), static_cast<void *>(0))
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(m_lockPrio), /* prev lock prio */
static_cast<uint8_t>(QF_TX_PRIO_OFFSET + QF_MAX_ACTIVE
- m_prevThre)); // new lock prio
QS_END_()
// restore the preemption threshold of the lock holder
UINT old_thre;
Q_ALLEGE_ID(810, tx_thread_preemption_change(m_lockHolder,
m_prevThre,
&old_thre) == TX_SUCCESS);
}
} // namespace QP

View File

@ -1,36 +1,40 @@
//////////////////////////////////////////////////////////////////////////////
// Product: QF/C++ port to ThreadX
// Last updated for version 5.4.0
// Last updated on 2015-05-13
//
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, www.state-machine.com.
//
// 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:
// Web: www.state-machine.com
// Email: info@state-machine.com
//////////////////////////////////////////////////////////////////////////////
/// @file
/// @brief QF/C++ port to ThreadX kernel, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// 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:
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
#ifndef qf_port_h
#define qf_port_h
@ -63,6 +67,32 @@
//
#ifdef QP_IMPL
// ThreadX-specific scheduler locking (implemented in qf_port.cpp)
#define QF_SCHED_STAT_TYPE_ QFSchedLock
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (_tx_thread_system_state != static_cast<UINT>(0)) { \
(pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->lock((prio_)); \
} \
} while (false)
#define QF_SCHED_UNLOCK_(pLockStat_) (pLockStat_)->unlock()
namespace QP {
struct QFSchedLock {
uint_fast8_t m_lockPrio; //!< lock prio [QF numbering scheme]
UINT m_prevThre; //!< previoius preemption threshold
TX_THREAD *m_lockHolder; //!< the thread holding the lock
void lock(uint_fast8_t prio);
void unlock(void) const;
};
} // namespace QP
extern "C" {
extern UINT _tx_thread_system_state; // internal TX interrupt counter
}
// TreadX block pool operations
#define QF_EPOOL_TYPE_ TX_BLOCK_POOL
#define QF_EPOOL_INIT_(pool_, poolSto_, poolSize_, evtSize_) \

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to uC/OS-II (V2.92) kernel, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.4.0
/// Last updated on 2015-05-11
/// Last updated for version 5.6.2
/// Last updated on 2016-03-09
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
////**************************************************************************
/// @endcond
@ -105,7 +105,7 @@ void QMActive::start(uint_fast8_t prio,
p_ucos, // uC/OS-II task priority
static_cast<INT16U>(prio), // the unique QP priority is the task id
static_cast<OS_STK *>(stkSto), // pbos
static_cast<INT32U>(stkSize/sizeof(OS_STK)),// stack size in OS_STK units
static_cast<INT32U>(stkSize/sizeof(OS_STK)),// size in OS_STK units
static_cast<void *>(0), // pext
static_cast<INT16U>(m_thread)); // task options, see NOTE1
@ -171,11 +171,13 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// posting the event to uC/OS-II message queue must succeed, NOTE3
Q_ALLEGE_ID(710,
OSQPost(m_eQueue, const_cast<QEvt *>(e)) == OS_ERR_NONE);
status = true; // report event posted
status = true; // report success
}
else {
// can tolerate dropping evts?
@ -192,10 +194,11 @@ bool QMActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_EQC_(static_cast<QEQueueCtr>(0)); // min # free (unknown)
QS_END_NOCRIT_()
status = false; // return failure
}
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;
}
//............................................................................
@ -219,11 +222,11 @@ void QMActive::postLIFO(QEvt const * const e) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// posting the event to uC/OS-II message queue must succeed, NOTE3
Q_ALLEGE_ID(810,
OSQPostFront(m_eQueue, const_cast<QEvt *>(e)) == OS_ERR_NONE);
QF_CRIT_EXIT_();
}
//............................................................................
QEvt const *QMActive::get_(void) {

View File

@ -2,14 +2,14 @@
/// @brief QF/C++ port to uC/OS-II (V2.92) kernel, all supported compilers
/// @cond
///***************************************************************************
/// Last updated for version 5.4.0
/// Last updated on 2015-05-11
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
@ -73,6 +73,19 @@ void QF_setUCosTaskAttr(QMActive *act, uint32_t attr);
//
#ifdef QP_IMPL
// uC/OS-II-specific scheduler locking, see NOTE2
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, prio_) do { \
if (OSIntNesting != (INT8U)0) { \
(pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1); \
} else { \
(pLockStat_)->m_lockPrio = (prio_); \
OSSchedLock(); \
} \
} while (0)
#define QF_SCHED_UNLOCK_(dummy) OSSchedUnlock()
// uC/OS-II event pool operations
#define QF_EPOOL_TYPE_ OS_MEM*
#define QF_EPOOL_INIT_(pool_, poolSto_, poolSize_, evtSize_) do { \
@ -108,3 +121,8 @@ void QF_setUCosTaskAttr(QMActive *act, uint32_t attr);
// NOTE1:
// The uC/OS-II critical section must be able to nest.
//
// NOTE2:
// uC/OS-II provides only global scheduler locking for all thread priorities
// by means of OSSchedLock() and OSSchedUnlock(). Therefore, locking the
// scheduler only up to the specified lock priority is not supported.
//

Binary file not shown.

View File

@ -2,14 +2,14 @@
/// \brief QF/C++ port to Win32 API with cooperative QV scheduler (win32-qv)
/// \cond
///***************************************************************************
/// Last updated for version 5.4.2
/// Last updated on 2015-06-05
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// \endcond
@ -134,6 +134,14 @@ void QF_onClockTick(void);
// interface used only inside QF, but not in applications
#ifdef QP_IMPL
// Win32-QV specific scheduler locking, see NOTE2
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, dummy) \
((pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1))
#define QF_SCHED_UNLOCK_(dummy) ((void)0)
// native event queue operations...
#define QACTIVE_EQUEUE_WAIT_(me_) \
Q_ASSERT((me_)->m_eQueue.m_frontEvt != static_cast<QEvt const *>(0))
@ -205,6 +213,10 @@ void QF_onClockTick(void);
// information.
//
// NOTE2:
// Scheduler locking (used inside QF_publish_()) is not needed in the single-
// threaded Win32-QV port, because event multicasting is already atomic.
//
// NOTE3:
// Windows is not a deterministic real-time system, which means that the
// system can occasionally and unexpectedly "choke and freeze" for a number
// of seconds. The designers of Windows have dealt with these sort of issues

Binary file not shown.

View File

@ -2,14 +2,14 @@
/// \brief QF/C++ port to Win32 API
/// \cond
///***************************************************************************
/// Last updated for version 5.4.2
/// Last updated on 2015-06-05
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// http://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// \endcond
@ -139,6 +139,16 @@ void QF_onClockTick(void);
// interface used only inside QF, but not in applications
#ifdef QP_IMPL
// Win32-specific scheduler locking, see NOTE2
#define QF_SCHED_STAT_TYPE_ struct { uint_fast8_t m_lockPrio; }
#define QF_SCHED_LOCK_(pLockStat_, dummy) do { \
QF_enterCriticalSection_(); \
((pLockStat_)->m_lockPrio = \
static_cast<uint_fast8_t>(QF_MAX_ACTIVE)); \
} while (false)
#define QF_SCHED_UNLOCK_(dummy) QF_leaveCriticalSection_()
// Win32-specific event queue customization
#define QACTIVE_EQUEUE_WAIT_(me_) \
while ((me_)->m_eQueue.m_frontEvt == static_cast<QEvt const *>(0)) { \
@ -211,6 +221,12 @@ void QF_onClockTick(void);
// information.
//
// NOTE2:
// Scheduler locking (used inside QF_publish_()) is implemented in this
// port with the main critical section. This means that event multicasting
// will appear atomic, in the sense that no thread will be able to post
// events during multicasting.
//
// NOTE3:
// Windows is not a deterministic real-time system, which means that the
// system can occasionally and unexpectedly "choke and freeze" for a number
// of seconds. The designers of Windows have dealt with these sort of issues

View File

@ -4,7 +4,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 5.6.2
/// Last updated on 2016-02-10
/// Last updated on 2016-02-11
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -65,7 +65,8 @@ Q_DEFINE_THIS_MODULE("qf_defer")
/// An active object can use multiple event queues to defer events of
/// different kinds.
///
/// @sa QP::QMActive::recall(), QP::QEQueue
/// @sa QP::QMActive::recall(), QP::QEQueue, QP::QMActive::flushDeferred()
///
bool QMActive::defer(QEQueue * const eq, QEvt const * const e) const {
return eq->post(e, static_cast<uint_fast16_t>(1)); // non-asserting post
}
@ -87,6 +88,7 @@ bool QMActive::defer(QEQueue * const eq, QEvt const * const e) const {
/// different kinds.
///
/// @sa QP::QMActive::recall(), QP::QEQueue, QP::QMActive::postLIFO_()
///
bool QMActive::recall(QEQueue * const eq) {
QEvt const * const e = eq->get(); // try to get evt from deferred queue
bool const recalled = (e != static_cast<QEvt const *>(0));//evt available?
@ -127,6 +129,7 @@ bool QMActive::recall(QEQueue * const eq) {
///
///
/// @sa QP::QMActive::defer(), QP::QMActive::recall(), QP::QEQueue
///
uint_fast16_t QMActive::flushDeferred(QEQueue * const eq) const {
uint_fast16_t n = static_cast<uint_fast16_t>(0);
for (QEvt const *e = eq->get();

View File

@ -4,14 +4,14 @@
/// @ingroup qf
/// @cond
///***************************************************************************
/// Last updated for version 5.6.0
/// Last updated on 2015-12-26
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps. All rights reserved.
/// 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
@ -97,19 +97,20 @@ void QF::psInit(QSubscrList * const subscrSto, enum_t const maxSignal) {
//****************************************************************************
/// @description
/// This function posts (using the FIFO policy) the event @p e to ALL
/// active objects that have subscribed to the signal @p e->sig.
/// This function is designed to be callable from any part of the system,
/// including ISRs, device drivers, and active objects.
/// This function posts (using the FIFO policy) the event @a e to **all**
/// active objects that have subscribed to the signal @a e->sig, which is
/// called _multicasting_. The multicasting performed in this function is
/// very efficient based on reference-counting inside the published event
/// ("zero-copy" event multicasting). This function is designed to be
/// callable from any part of the system, including ISRs, device drivers,
/// and active objects.
///
/// @note
/// In the general case, event publishing requires multicasting the
/// event to multiple subscribers. This happens in the caller's thread with
/// the scheduler locked to prevent preemption during the multicasting
/// process. (Please note that the interrupts are not locked.)
///
/// @attention
/// This function should be called only via the macro PUBLISH()
/// To avoid any unexpected re-ordering of events posted into AO queues,
/// the event multicasting is performed with scheduler __locked__. However,
/// the scheduler is locked only up to the priority level of the highest-
/// priority subscriber, so any AOs of even higher priority, which did not
/// subscribe to this event are _not_ affected.
///
#ifndef Q_SPY
void QF::publish_(QEvt const * const e) {
@ -136,11 +137,23 @@ void QF::publish_(QEvt const * const e, void const * const sender) {
}
QF_CRIT_EXIT_();
QF_SCHED_STAT_TYPE_ lockStat;
lockStat.m_lockPrio = static_cast<uint_fast8_t>(0xFF); // uninitialized
#if (QF_MAX_ACTIVE <= 8)
uint8_t tmp = QF_PTR_AT_(QF_subscrList_, e->sig).m_bits[0];
uint_fast8_t tmp = static_cast<uint_fast8_t>(
QF_PTR_AT_(QF_subscrList_, e->sig).m_bits[0]);
while (tmp != static_cast<uint8_t>(0)) {
uint8_t p = QF_LOG2(tmp);
tmp &= QF_invPwr2Lkup[p]; // clear the subscriber bit
uint_fast8_t p = static_cast<uint_fast8_t>(QF_LOG2(tmp));
// clear the subscriber bit
tmp &= static_cast<uint_fast8_t>(QF_invPwr2Lkup[p]);
// has the scheduler been locked yet?
if (lockStat.m_lockPrio == static_cast<uint_fast8_t>(0xFF)) {
QF_SCHED_LOCK_(&lockStat, p);
}
// the priority of the AO must be registered with the framework
Q_ASSERT_ID(110, active_[p] != static_cast<QMActive *>(0));
@ -149,17 +162,26 @@ void QF::publish_(QEvt const * const e, void const * const sender) {
(void)active_[p]->POST(e, sender);
}
#else
uint8_t i = QF_SUBSCR_LIST_SIZE;
uint_fast8_t i = static_cast<uint_fast8_t>(QF_SUBSCR_LIST_SIZE);
// go through all bytes in the subscription list
do {
--i;
uint8_t tmp = QF_PTR_AT_(QF_subscrList_, e->sig).m_bits[i];
while (tmp != static_cast<uint8_t>(0)) {
uint8_t p = QF_LOG2(tmp);
tmp &= QF_invPwr2Lkup[p]; // clear the subscriber bit
uint_fast8_t tmp = static_cast<uint_fast8_t>(
QF_PTR_AT_(QF_subscrList_, e->sig).m_bits[i]);
while (tmp != static_cast<uint_fast8_t>(0)) {
uint_fast8_t p = static_cast<uint_fast8_t>(QF_LOG2(tmp));
// clear the subscriber bit
tmp &= static_cast<uint_fast8_t>(QF_invPwr2Lkup[p]);
// adjust the priority
p = static_cast<uint8_t>(p + static_cast<uint8_t>(i << 3));
p += static_cast<uint_fast8_t>(i << 3);
// has the scheduler been locked yet?
if (lockStat.m_lockPrio == static_cast<uint_fast8_t>(0xFF)) {
QF_SCHED_LOCK_(&lockStat, p);
}
// the priority level be registered with the framework
Q_ASSERT(active_[p] != static_cast<QMActive *>(0));
@ -167,9 +189,14 @@ void QF::publish_(QEvt const * const e, void const * const sender) {
// POST() asserts internally if the queue overflows
(void)active_[p]->POST(e, sender);
}
} while (i != static_cast<uint8_t>(0));
} while (i != static_cast<uint_fast8_t>(0));
#endif
// was the scheduler locked?
if (lockStat.m_lockPrio <= static_cast<uint_fast8_t>(QF_MAX_ACTIVE)) {
QF_SCHED_UNLOCK_(&lockStat); // unlock the scheduler
}
// run the garbage collector
gc(e);

View File

@ -81,7 +81,7 @@ void QF::tickX_(uint8_t const tickRate, void const * const sender)
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_TICK, static_cast<void *>(0), static_cast<void *>(0))
QS_BEGIN_NOCRIT_(QS_QF_TICK, static_cast<void*>(0), static_cast<void*>(0))
QS_TEC_(static_cast<QTimeEvtCtr>(++prev->m_ctr)); // tick ctr
QS_U8_(tickRate); // tick rate
QS_END_NOCRIT_()

View File

@ -4,14 +4,14 @@
/// @cond
///***************************************************************************
/// Product: QK/C++
/// Last updated for version 5.6.0
/// Last updated on 2015-12-30
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
/// 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
@ -55,21 +55,22 @@
// Public-scope objects ******************************************************
extern "C" {
Q_DEFINE_THIS_MODULE("qk")
#if (QF_MAX_ACTIVE <= 8)
QP::QPSet8 QK_readySet_; // ready set of AOs
#else
QP::QPSet64 QK_readySet_; // ready set of AOs
#endif
uint_fast8_t volatile QK_currPrio_;
uint_fast8_t volatile QK_intNest_;
uint_fast8_t volatile QK_currPrio_; // priority of the current task
uint_fast8_t volatile QK_lockPrio_; // scheduler lock ceiling
uint_fast8_t volatile QK_intNest_; // ISR nesting level
} // extern "C"
namespace QP {
Q_DEFINE_THIS_MODULE("qk")
//****************************************************************************
/// @description
/// Initializes QF and must be called exactly once before any other QF
@ -84,8 +85,8 @@ Q_DEFINE_THIS_MODULE("qk")
void QF::init(void) {
extern uint_fast8_t QF_maxPool_;
// scheduler locked
QK_currPrio_ = static_cast<uint_fast8_t>(QF_MAX_ACTIVE + 1);
QK_currPrio_ = static_cast<uint_fast8_t>(0); // prio of the QK idle loop
QK_lockPrio_ = static_cast<uint_fast8_t>(QF_MAX_ACTIVE);//scheduler locked
#ifndef QK_ISR_CONTEXT_
QK_intNest_ = static_cast<uint_fast8_t>(0); // no nesting level
@ -123,8 +124,8 @@ void QF::stop(void) {
//! process all events posted during initialization */
static void initial_events(void); // prototype
static void initial_events(void) {
// set priority for the QK idle loop
QK_currPrio_ = static_cast<uint_fast8_t>(0);
QK_lockPrio_ = static_cast<uint_fast8_t>(0); // scheduler unlocked
uint_fast8_t p = QK_schedPrio_();
// any active objects need to be scheduled before starting event loop?
@ -189,7 +190,6 @@ void QMActive::start(uint_fast8_t const prio,
m_eQueue.init(qSto, qLen); // initialize QEQueue of this AO
m_prio = prio; // set the QF priority of this AO
m_thread = prio; // set the start priority of the AO
QF::add_(this); // make QF aware of this AO
// QK kernel does not need per-thread stack
@ -235,12 +235,19 @@ extern "C" {
/// __disabled__ and returns with interrupts __disabled__.
///
uint_fast8_t QK_schedPrio_(void) {
// find the highest-prio AO with non-empty event queue
uint_fast8_t p = QK_readySet_.findMax();
// is the priority below the current preemption threshold?
// is the highest-prio below the current-prio?
if (p <= QK_currPrio_) {
p = static_cast<uint_fast8_t>(0); // active object not eligible
}
else if (p <= QK_lockPrio_) { // is it below the lock prio?
p = static_cast<uint_fast8_t>(0); // active object not eligible
}
else {
Q_ASSERT_ID(610, p <= static_cast<uint_fast8_t>(QF_MAX_ACTIVE));
}
return p;
}
@ -269,7 +276,7 @@ void QK_sched_(uint_fast8_t p) {
a = QP::QF::active_[p]; // obtain the pointer to the AO
QK_currPrio_ = p; // this becomes the current task priority
QS_BEGIN_NOCRIT_(QP::QS_QVK_SCHEDULE, QP::QS::priv_.aoObjFilter, a)
QS_BEGIN_NOCRIT_(QP::QS_SCHED_NEXT, QP::QS::priv_.aoObjFilter, a)
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(p), // prio of the scheduled AO
static_cast<uint8_t>(pprev)); // previous priority
@ -296,12 +303,8 @@ void QK_sched_(uint_fast8_t p) {
// determine the next highest-priority AO ready to run...
QF_INT_DISABLE();
p = QK_readySet_.findMax(); // find new highest-prio AO ready to run
// is the new priority below the current preemption threshold?
if (p <= pin) {
p = static_cast<uint_fast8_t>(0);
}
// find new highest-prio AO ready to run...
p = QK_schedPrio_();
} while (p != static_cast<uint_fast8_t>(0));
@ -311,14 +314,14 @@ void QK_sched_(uint_fast8_t p) {
if (pin != static_cast<uint_fast8_t>(0)) { // resuming an active object?
a = QP::QF::active_[pin]; // the pointer to the preempted AO
QS_BEGIN_NOCRIT_(QP::QS_QK_RESUME, QP::QS::priv_.aoObjFilter, a)
QS_BEGIN_NOCRIT_(QP::QS_SCHED_RESUME, QP::QS::priv_.aoObjFilter, a)
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(pin), // prio of the resumed AO
static_cast<uint8_t>(pprev)); // previous priority
QS_END_NOCRIT_()
}
else { // resuming priority==0 --> idle
QS_BEGIN_NOCRIT_(QP::QS_QVK_IDLE,
QS_BEGIN_NOCRIT_(QP::QS_SCHED_IDLE,
static_cast<void *>(0), static_cast<void *>(0))
QS_TIME_(); // timestamp
QS_U8_(static_cast<uint8_t>(pprev)); // previous priority

View File

@ -5,8 +5,8 @@
/// @cond
///***************************************************************************
/// Product: QK/C++
/// Last updated for version 5.6.0
/// Last updated on 2015-12-30
/// Last updated for version 5.6.2
/// Last updated on 2016-03-31
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -57,166 +57,112 @@ namespace QP {
Q_DEFINE_THIS_MODULE("qk_mutex")
enum {
MUTEX_UNUSED = 0xFF
};
//****************************************************************************
/// @description
/// Initialize the QK priority ceiling mutex.
/// Initializes QK priority-ceiling mutex to the specified ceiling priority.
///
/// @param[in] prioCeiling ceiling priotity of the mutex
/// @param[in] prio ceiling priority of the mutex
///
/// @note The ceiling priority must be unused by any AO. The ceiling
/// priority must be higher than priority of any AO that uses the
/// protected resource.
/// @note
/// A mutex must be initialized before it can be locked or unlocked.
///
/// @sa QP::QMutex::lock(), QP::QMutex::unlock()
///
/// @usage
/// The following example shows how to initialize, lock and unlock QK mutex:
/// @include qk_mux.cpp
///
void QMutex::init(uint_fast8_t const prioCeiling) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
/// @pre the celiling priority of the mutex must not be zero and cannot
/// exceed the maximum #QF_MAX_ACTIVE. Also, the ceiling priority must
/// not be already in use. QF requires priority to be __unique__.
///
Q_REQUIRE_ID(100, (static_cast<uint_fast8_t>(0) < prioCeiling)
&& (prioCeiling <= (uint_fast8_t)QF_MAX_ACTIVE)
&& (QF::active_[prioCeiling] == static_cast<QMActive *>(0)));
m_prioCeiling = prioCeiling;
m_lockNest = static_cast<uint_fast8_t>(0);
// reserve the ceiling priority level for this mutex
QF::active_[prioCeiling] = reinterpret_cast<QMActive *>(this);
QF_CRIT_EXIT_();
void QMutex::init(uint_fast8_t const prio) {
m_lockPrio = prio;
m_prevPrio = static_cast<uint_fast8_t>(MUTEX_UNUSED);
}
//****************************************************************************
/// @description
/// Lock the QK priority ceiling mutex.
/// This function locks the QK mutex.
///
/// @note This function should be always paired with QXK_mutexUnlock(). The
/// code between QK_mutexLock() and QK_mutexUnlock() should be kept to the
/// minimum.
/// @note
/// A mutex must be initialized before it can be locked or unlocked.
///
/// @note
/// QP::QMutex::lock() must be always followed by the corresponding
/// QP::QMutex::unlock().
///
/// @sa QP::QMutex::init(), QP::QMutex::unlock()
///
/// @usage
/// The following example shows how to initialize, lock and unlock QK mutex:
/// @include qk_mux.cpp
///
void QMutex::lock(void) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
// is the scheduler unloacked?
if (QK_currPrio_ <= static_cast<uint_fast8_t>(QF_MAX_ACTIVE)) {
QMActive *act = QF::active_[QK_currPrio_];
/// @pre QMutex_lock() must not be called from ISR level,
/// the thread priority must not exceed the mutex priority ceiling
/// and the mutex must be initialized.
///
Q_REQUIRE_ID(200, (!QK_ISR_CONTEXT_()) /* don't call from an ISR! */
&& (act->m_thread <= m_prioCeiling)
&& (QF::active_[m_prioCeiling] != static_cast<QMActive *>(0)));
/// @pre scheduler cannot be locked from the ISR context
/// and the mutex must be unused
Q_REQUIRE_ID(700, (!QK_ISR_CONTEXT_())
&& (m_prevPrio == static_cast<uint_fast8_t>(MUTEX_UNUSED)));
// is the mutex available?
if (m_lockNest == static_cast<uint_fast8_t>(0)) {
m_lockNest = static_cast<uint_fast8_t>(1);
// the priority slot must be set to this mutex
Q_ASSERT_ID(210, QF::active_[m_prioCeiling]
== reinterpret_cast<QMActive *>(this));
// switch the priority of this thread to the ceiling priority
QF::active_[m_prioCeiling] = act;
// set to the ceiling
act->m_prio = m_prioCeiling;
if (QK_readySet_.hasElement(act->m_thread)) {
QK_readySet_.remove(act->m_thread);
QK_readySet_.insert(act->m_prio);
m_prevPrio = QK_lockPrio_; // save the previous prio
if (QK_lockPrio_ < m_lockPrio) { // raising the lock prio?
QK_lockPrio_ = m_lockPrio;
}
QK_currPrio_ = act->m_prio;
QS_BEGIN_NOCRIT_(QS_QK_MUTEX_LOCK,
QS_BEGIN_NOCRIT_(QS_SCHED_LOCK,
static_cast<void *>(0), static_cast<void *>(0))
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(act->m_thread), // the start prio
static_cast<uint8_t>(act->m_prio)); // current ceiling
QS_2U8_(static_cast<uint8_t>(m_prevPrio), /* the previous lock prio */
static_cast<uint8_t>(QK_lockPrio_)); // the new lock prio
QS_END_NOCRIT_()
}
// is the mutex locked by this thread already (nested locking)?
else if (QF::active_[m_prioCeiling] == act) {
++m_lockNest;
}
// the mutex can't be locked by a different AO -- error
else {
Q_ERROR_ID(220);
}
}
QF_CRIT_EXIT_();
}
//****************************************************************************
/// @description
/// Unlock the QK priority ceiling mutex.
/// This function unlocks the QK mutex.
///
/// @param[in,out] me pointer (see @ref oop)
/// @note
/// A mutex must be initialized before it can be locked or unlocked.
///
/// @note This function should be always paired with QK_mutexLock(). The
/// code between QK_mutexLock() and QK_mutexUnlock() should be kept to the
/// minimum.
/// @note
/// QP::QMutex::unlock() must always follow the corresponding
/// QP::QMutex::lock().
///
/// @sa QP::QMutex::init(), QP::QMutex::lock()
///
/// @usage
/// The following example shows how to initialize, lock and unlock QK mutex:
/// @include qk_mux.cpp
///
void QMutex::unlock(void) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
// is the scheduler unloacked?
if (QK_currPrio_ <= static_cast<uint_fast8_t>(QF_MAX_ACTIVE)) {
QMActive *act = QF::active_[QK_currPrio_];
/// @pre QMutex_unlock() must not be called from ISR level
/// and the mutex must be owned by this thread.
///
Q_REQUIRE_ID(300, (!QK_ISR_CONTEXT_()) /* don't call from an ISR! */
&& (m_lockNest > static_cast<uint_fast8_t>(0))
&& (QF::active_[m_prioCeiling] == act));
/// @pre scheduler cannot be unlocked from the ISR context
/// and the mutex must not be unused
Q_REQUIRE_ID(800, (!QK_ISR_CONTEXT_())
&& (m_prevPrio != static_cast<uint_fast8_t>(MUTEX_UNUSED)));
// Unlocking the first nesting level?
if (m_lockNest == static_cast<uint_fast8_t>(1)) {
uint_fast8_t p;
m_lockNest = static_cast<uint_fast8_t>(0);
// reclaim the ceiling priority for this mutex
QF::active_[m_prioCeiling] = reinterpret_cast<QMActive *>(this);
// restore the start priority for this AO...
act->m_prio = act->m_thread;
QK_currPrio_ = act->m_thread;
if (QK_readySet_.hasElement(m_prioCeiling)) {
QK_readySet_.remove(m_prioCeiling);
QK_readySet_.insert(act->m_thread);
}
QS_BEGIN_NOCRIT_(QS_QK_MUTEX_UNLOCK,
QS_BEGIN_NOCRIT_(QS_SCHED_UNLOCK,
static_cast<void *>(0), static_cast<void *>(0))
QS_TIME_(); // timestamp
QS_2U8_(static_cast<uint8_t>(act->m_thread), // the start prio
static_cast<uint8_t>(m_prioCeiling));// curr ceiling
QS_2U8_(static_cast<uint8_t>(m_prevPrio),/* the previouis lock prio */
static_cast<uint8_t>(QK_lockPrio_)); // the new lock prio
QS_END_NOCRIT_()
// find if some other AO has higher priority than the current
p = QK_schedPrio_();
if (p != static_cast<uint_fast8_t>(0)) {
QK_sched_(p);
}
}
// this AO is releasing a nested mutex lock
else {
--m_lockNest;
uint_fast8_t p = m_prevPrio;
m_prevPrio = static_cast<uint_fast8_t>(MUTEX_UNUSED);
if (QK_lockPrio_ > p) {
QK_lockPrio_ = p; // restore the previous lock prio
p = QK_schedPrio_(); // find the highest-prio AO ready to run
if (p != static_cast<uint_fast8_t>(0)) { // priority found?
QK_sched_(p); // schedule any unlocked AOs
}
}
QF_CRIT_EXIT_();

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