Skip to content

Commit 8bfeded

Browse files
committed
8.1.0
1 parent c54eab0 commit 8bfeded

File tree

96 files changed

+15006
-11857
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+15006
-11857
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@
5050
*.idb
5151
*.pdb
5252

53-
# GCOV files
53+
# GCOV files and coverage logs
5454
*.gcda
5555
*.gcno
56+
*.cov
57+
*.host
58+
*.trg
5659

5760
# Kernel Module Compile Results
5861
*.mod*

arm-cm/blinky_ek-tm4c123gxl/qk/bsp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "bsp.h" // Board Support Package
3737

3838
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
4039
#include "sysctl.h" // system control driver (TI)
4140
#include "gpio.h" // GPIO driver (TI)
4241
// add other drivers if necessary...

arm-cm/blinky_ek-tm4c123gxl/qv/bsp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "bsp.h" // Board Support Package
3737

3838
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
4039
#include "sysctl.h" // system control driver (TI)
4140
#include "gpio.h" // GPIO driver (TI)
4241
// add other drivers if necessary...

arm-cm/blinky_ek-tm4c123gxl/qxk/bsp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "bsp.h" // Board Support Package
3232

3333
#include "TM4C123GH6PM.h" // the device specific header (TI)
34-
#include "rom.h" // the built-in ROM functions (TI)
3534
#include "sysctl.h" // system control driver (TI)
3635
#include "gpio.h" // GPIO driver (TI)
3736
// add other drivers if necessary...

arm-cm/dpp_ek-tm4c123gxl/qk/bsp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//============================================================================
22
// Product: DPP example, EK-TM4C123GXL board, QK kernel
3-
// Last updated for version 8.0.0
4-
// Last updated on 2024-09-18
53
//
64
// Q u a n t u m L e a P s
75
// ------------------------
@@ -36,7 +34,6 @@
3634
#include "bsp.h" // Board Support Package
3735

3836
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
4037
#include "sysctl.h" // system control driver (TI)
4138
#include "gpio.h" // GPIO driver (TI)
4239
// add other drivers if necessary...

arm-cm/dpp_ek-tm4c123gxl/qv/bsp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "bsp.h" // Board Support Package
3737

3838
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
4039
#include "sysctl.h" // system control driver (TI)
4140
#include "gpio.h" // GPIO driver (TI)
4241
// add other drivers if necessary...

arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "bsp.h" // Board Support Package
3737

3838
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
4039
#include "sysctl.h" // system control driver (TI)
4140
#include "gpio.h" // GPIO driver (TI)
4241
// add other drivers if necessary...

arm-cm/low-power_ek-tm4c123gxl/qk/bsp.c

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
//============================================================================
22
// Product: "Low-Power" example, EK-TM4C123GXL board, QK kernel
3-
// Last updated for version 7.3.0
4-
// Last updated on 2023-07-23
53
//
64
// Q u a n t u m L e a P s
75
// ------------------------
86
// Modern Embedded Software
97
//
10-
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
8+
// Copyright (C) 2005 Quantum Leaps, LLC. <state-machine.com>
119
//
1210
// This program is open source software: you can redistribute it and/or
1311
// modify it under the terms of the GNU General Public License as published
@@ -31,14 +29,13 @@
3129
// <www.state-machine.com/licensing>
3230
3331
//============================================================================
34-
#include "qpc.h"
35-
#include "low_power.h"
36-
#include "bsp.h"
32+
#include "qpc.h" // QP/C real-time event framework
33+
#include "low_power.h" // this application interface
34+
#include "bsp.h" // Board Support Package
3735

38-
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
40-
#include "sysctl.h" // system control driver (TI)
41-
#include "gpio.h" // GPIO driver (TI)
36+
#include "TM4C123GH6PM.h" // the device specific header (TI)
37+
#include "sysctl.h" // system control driver (TI)
38+
#include "gpio.h" // GPIO driver (TI)
4239
// add other drivers if necessary...
4340

4441
//Q_DEFINE_THIS_FILE
@@ -47,11 +44,11 @@
4744
#error The low-power example does not provide Spy build configuration
4845
#endif
4946

50-
// ISRs defined in this BSP ------------------------------------------------
47+
// ISRs defined in this BSP --------------------------------------------------
5148
void SysTick_Handler(void);
5249
void GPIOPortA_IRQHandler(void);
5350

54-
// Local-scope objects -----------------------------------------------------
51+
// Local-scope objects -------------------------------------------------------
5552

5653
// bitmask of active sub-systems needed for low-power operation.
5754
// NOTE: shared between the idle thread application, see NOTE1
@@ -72,7 +69,7 @@ enum {
7269

7370
#define XTAL_HZ 16000000U
7471

75-
// ISRs used in this project ===============================================
72+
// ISRs used in this project =================================================
7673
void SysTick_Handler(void) {
7774
QK_ISR_ENTRY(); // inform QK about entering an ISR
7875
QTIMEEVT_TICK_X(0U, (void *)0); // process time events for rate 0
@@ -98,28 +95,26 @@ void GPIOPortF_IRQHandler(void) {
9895

9996
// BSP functions ===========================================================
10097
void BSP_init(void) {
101-
// Set the clocking to run directly from the crystal
102-
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
103-
SYSCTL_XTAL_16MHZ);
104-
SystemCoreClock = XTAL_HZ;
105-
10698
// NOTE The VFP (Floating Point Unit) unit is configured by QK-port
10799

108-
// configure Timer0, but don't enable the interrupt just yet
109-
SYSCTL->RCGCTIMER |= (1U << 0); // enable Run mode for Timer0
100+
// enable clock for to the peripherals used by this application...
101+
SYSCTL->RCGCGPIO |= (1U << 5U); // enable Run mode for GPIOF
102+
SYSCTL->RCGCTIMER |= (1U << 0U); // enable Run mode for Timer0
103+
104+
// configure the Timers
110105
TIMER0->CTL &= ~(1U << 0); // disable Timer0 before any changes
111106
TIMER0->CFG = 0U;
112107
TIMER0->TAMR |= (0x2 << 0); // Timer0A
113108
TIMER0->TAMR &= ~(1U << 4);
114109
TIMER0->TAILR = XTAL_HZ / BSP_TICKS1_PER_SEC;
115110
TIMER0->IMR &= ~(1U << 0); // disable timer interrupt for now
116-
SYSCTL->RCGCTIMER &= ~(1U << 0); // disable Run mode for Timer0
111+
SYSCTL->RCGCTIMER &= ~(1U << 0); // disable Run mode for Timer0
117112

118113
// configure the LEDs and push buttons
119114
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF
120-
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE);// set direction: output
115+
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE); // direction: output
121116
GPIOF->DEN |= (LED_RED | LED_GREEN | LED_BLUE); // digital enable
122-
GPIOF->DATA_Bits[LED_RED | LED_GREEN | LED_BLUE] = 0U; // turn off
117+
GPIOF->DATA_Bits[LED_RED | LED_GREEN | LED_BLUE] = 0U; // turn off
123118

124119
// configure the button SW1
125120
GPIOF->DIR &= ~BTN_SW1; // input
@@ -185,6 +180,9 @@ void QF_onStartup(void) {
185180
// enable IRQs in the NVIC...
186181
NVIC_EnableIRQ(GPIOF_IRQn);
187182
NVIC_EnableIRQ(TIMER0A_IRQn);
183+
184+
// enable interrupts in hardware
185+
GPIOF->IM |= BTN_SW1; // enable GPIOF interrupt for SW1
188186
}
189187
//............................................................................
190188
void QF_onCleanup(void) {
@@ -204,8 +202,8 @@ void QK_onIdle(void) {
204202
&& QTimeEvt_noActive(1U)) // no time events at rate-1?
205203
{
206204
// safe to disable Timer0 and interrupt
207-
TIMER0->CTL &= ~(1U << 0); // disable Timer0
208-
TIMER0->IMR &= ~(1U << 0); // disable timer interrupt
205+
TIMER0->CTL &= ~(1U << 0U); // disable Timer0
206+
TIMER0->IMR &= ~(1U << 0U); // disable timer interrupt
209207
l_activeSet &= ~(1U << TIMER0_ACTIVE); // mark rate-1 as disabled
210208
}
211209
QF_INT_ENABLE();
@@ -222,15 +220,18 @@ Q_NORETURN Q_onError(char const * const module, int_t const id) {
222220
//
223221
Q_UNUSED_PAR(module);
224222
Q_UNUSED_PAR(id);
223+
QS_ASSERTION(module, id, 10000U); // report assertion to QS
225224

226225
#ifndef NDEBUG
227-
// for debugging, hang on in an endless loop toggling the RED LED...
228-
while (GPIOF->DATA_Bits[BTN_SW1] != 0) {
229-
GPIOF->DATA = LED_RED;
230-
GPIOF->DATA = 0U;
226+
// light up all LEDs
227+
GPIOF->DATA_Bits[LED_GREEN | LED_RED | LED_BLUE] = 0xFFU;
228+
for (;;) { // for debugging, hang on in an endless loop...
231229
}
232-
#endif
230+
#else
233231
NVIC_SystemReset();
232+
for (;;) { // explicitly "no-return"
233+
}
234+
#endif
234235
}
235236
//............................................................................
236237
void assert_failed(char const * const module, int_t const id); // prototype

arm-cm/low-power_ek-tm4c123gxl/qv/bsp.c

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
//============================================================================
22
// Product: "Low-Power" example, EK-TM4C123GXL board, QV kernel
3-
// Last updated for version 7.3.0
4-
// Last updated on 2023-07-23
53
//
64
// Q u a n t u m L e a P s
75
// ------------------------
86
// Modern Embedded Software
97
//
10-
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
8+
// Copyright (C) 2005 Quantum Leaps, LLC. <state-machine.com>
119
//
1210
// This program is open source software: you can redistribute it and/or
1311
// modify it under the terms of the GNU General Public License as published
@@ -31,14 +29,13 @@
3129
// <www.state-machine.com/licensing>
3230
3331
//============================================================================
34-
#include "qpc.h"
35-
#include "low_power.h"
36-
#include "bsp.h"
37-
38-
#include "TM4C123GH6PM.h" // the device specific header (TI)
39-
#include "rom.h" // the built-in ROM functions (TI)
40-
#include "sysctl.h" // system control driver (TI)
41-
#include "gpio.h" // GPIO driver (TI)
32+
#include "qpc.h" // QP/C real-time event framework
33+
#include "low_power.h" // this application interface
34+
#include "bsp.h" // Board Support Package
35+
36+
#include "TM4C123GH6PM.h" // the device specific header (TI)
37+
#include "sysctl.h" // system control driver (TI)
38+
#include "gpio.h" // GPIO driver (TI)
4239
// add other drivers if necessary...
4340

4441
//Q_DEFINE_THIS_FILE
@@ -47,11 +44,11 @@
4744
#error The low-power example does not provide Spy build configuration
4845
#endif
4946

50-
// ISRs defined in this BSP ------------------------------------------------
47+
// ISRs defined in this BSP --------------------------------------------------
5148
void SysTick_Handler(void);
5249
void GPIOPortA_IRQHandler(void);
5350

54-
// Local-scope objects -----------------------------------------------------
51+
// Local-scope objects -------------------------------------------------------
5552

5653
// bitmask of active sub-systems needed for low-power operation.
5754
// NOTE: shared between the idle thread application, see NOTE1
@@ -94,28 +91,26 @@ void GPIOPortF_IRQHandler(void) {
9491

9592
// BSP functions ===========================================================
9693
void BSP_init(void) {
97-
// Set the clocking to run directly from the crystal
98-
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
99-
SYSCTL_XTAL_16MHZ);
100-
SystemCoreClock = XTAL_HZ;
101-
10294
// NOTE The VFP (Floating Point Unit) unit is configured by QV-port
10395

104-
// configure Timer0, but don't enable the interrupt just yet
105-
SYSCTL->RCGCTIMER |= (1U << 0); // enable Run mode for Timer0
96+
// enable clock for to the peripherals used by this application...
97+
SYSCTL->RCGCGPIO |= (1U << 5U); // enable Run mode for GPIOF
98+
SYSCTL->RCGCTIMER |= (1U << 0U); // enable Run mode for Timer0
99+
100+
// configure the Timers
106101
TIMER0->CTL &= ~(1U << 0); // disable Timer0 before any changes
107102
TIMER0->CFG = 0U;
108103
TIMER0->TAMR |= (0x2 << 0); // Timer0A
109104
TIMER0->TAMR &= ~(1U << 4);
110105
TIMER0->TAILR = XTAL_HZ / BSP_TICKS1_PER_SEC;
111106
TIMER0->IMR &= ~(1U << 0); // disable timer interrupt for now
112-
SYSCTL->RCGCTIMER &= ~(1U << 0); // disable Run mode for Timer0
107+
SYSCTL->RCGCTIMER &= ~(1U << 0); // disable Run mode for Timer0
113108

114109
// configure the LEDs and push buttons
115110
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF
116-
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE);// set direction: output
111+
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE); // direction: output
117112
GPIOF->DEN |= (LED_RED | LED_GREEN | LED_BLUE); // digital enable
118-
GPIOF->DATA_Bits[LED_RED | LED_GREEN | LED_BLUE] = 0U; // turn off
113+
GPIOF->DATA_Bits[LED_RED | LED_GREEN | LED_BLUE] = 0U; // turn off
119114

120115
// configure the button SW1
121116
GPIOF->DIR &= ~BTN_SW1; // input
@@ -202,8 +197,8 @@ void QV_onIdle(void) { // NOTE: called with interrupts DISABLED
202197
&& QTimeEvt_noActive(1U)) // no time events at rate-1?
203198
{
204199
// safe to disable Timer0 and interrupt
205-
TIMER0->CTL &= ~(1U << 0); // disable Timer0
206-
TIMER0->IMR &= ~(1U << 0); // disable timer interrupt
200+
TIMER0->CTL &= ~(1U << 0U); // disable Timer0
201+
TIMER0->IMR &= ~(1U << 0U); // disable timer interrupt
207202
l_activeSet &= ~(1U << TIMER0_ACTIVE); // mark rate-1 as disabled
208203
}
209204

@@ -219,15 +214,18 @@ Q_NORETURN Q_onError(char const * const module, int_t const id) {
219214
//
220215
Q_UNUSED_PAR(module);
221216
Q_UNUSED_PAR(id);
217+
QS_ASSERTION(module, id, 10000U); // report assertion to QS
222218

223219
#ifndef NDEBUG
224-
// for debugging, hang on in an endless loop toggling the RED LED...
225-
while (GPIOF->DATA_Bits[BTN_SW1] != 0) {
226-
GPIOF->DATA = LED_RED;
227-
GPIOF->DATA = 0U;
220+
// light up all LEDs
221+
GPIOF->DATA_Bits[LED_GREEN | LED_RED | LED_BLUE] = 0xFFU;
222+
for (;;) { // for debugging, hang on in an endless loop...
228223
}
229-
#endif
224+
#else
230225
NVIC_SystemReset();
226+
for (;;) { // explicitly "no-return"
227+
}
228+
#endif
231229
}
232230
//............................................................................
233231
void assert_failed(char const * const module, int_t const id); // prototype

0 commit comments

Comments
 (0)