-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for PinProbe and launchpad probe watchdog.
- Loading branch information
Showing
24 changed files
with
433 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import qst 1.0 | ||
import QtQml 2.0 | ||
|
||
AbstractConstraint { | ||
property var signal | ||
property int count: 0 | ||
property int maxCount: 0 | ||
|
||
function clear() { | ||
count = 0 | ||
} | ||
|
||
id: root | ||
|
||
// Private implementation | ||
QtObject { | ||
id: implementation | ||
function evaluate() { | ||
if (!enabled) { | ||
return | ||
} | ||
|
||
count++ | ||
Qst.verify(count <= maxCount, "Property 'count' in CounterConstraint '" | ||
+ name + "' exceeded maxCount (" + maxCount + ")") | ||
} | ||
} | ||
|
||
Testcase.onCreated: { | ||
Qst.verify(typeof(signal) !== "undefined", "Property 'signal' in CounterConstraint '" | ||
+ name + "' is undefined.") | ||
Qst.verify(typeof(signal.connect) === "function", "Property 'signal' in CounterConstraint '" | ||
+ name + "' is not a signal.") | ||
signal.connect(implementation.evaluate) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2018 The Qst project. | ||
** | ||
** Contact: https://github.com/rweickelt/qst | ||
** | ||
** $BEGIN_LICENSE$ | ||
** | ||
** This program is free 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. | ||
** 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/>. | ||
** | ||
** $END_LICENSE$ | ||
****************************************************************************/ | ||
|
||
|
||
#include <Board.h> | ||
|
||
/* | ||
* =============================== PIN =============================== | ||
*/ | ||
#include <ti/drivers/PIN.h> | ||
#include <ti/drivers/pin/PINCC26XX.h> | ||
|
||
const PIN_Config BoardGpioInitTable[] = { | ||
|
||
CC1310_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ | ||
CC1310_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ | ||
CC1310_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */ | ||
CC1310_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */ | ||
// CC1310_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */ | ||
CC1310_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */ | ||
CC1310_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */ | ||
// CC1310_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */ | ||
// CC1310_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */ | ||
// CC1310_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */ | ||
PIN_TERMINATE | ||
}; | ||
|
||
const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = { | ||
.intPriority = INT_PRI_LEVEL5, | ||
.swiPriority = 1 | ||
}; | ||
|
||
/* | ||
* =============================== Power =============================== | ||
*/ | ||
#include <ti/drivers/Power.h> | ||
#include <ti/drivers/power/PowerCC26XX.h> | ||
|
||
const PowerCC26XX_Config PowerCC26XX_config = { | ||
.policyInitFxn = NULL, | ||
.policyFxn = &PowerCC26XX_standbyPolicy, | ||
.calibrateFxn = &PowerCC26XX_calibrate, | ||
.enablePolicy = true, | ||
.calibrateRCOSC_LF = true, | ||
.calibrateRCOSC_HF = true, | ||
}; | ||
|
||
/* | ||
* =============================== UART =============================== | ||
*/ | ||
#include <ti/drivers/UART.h> | ||
#include <ti/drivers/uart/UARTCC26XX.h> | ||
|
||
UARTCC26XX_Object uartCC26XXObjects[CC1310_LAUNCHXL_UARTCOUNT]; | ||
|
||
uint8_t uartCC26XXRingBuffer[CC1310_LAUNCHXL_UARTCOUNT][32]; | ||
|
||
const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1310_LAUNCHXL_UARTCOUNT] = { | ||
{ | ||
.baseAddr = UART0_BASE, | ||
.powerMngrId = PowerCC26XX_PERIPH_UART0, | ||
.intNum = INT_UART0_COMB, | ||
.intPriority = ~0, | ||
.swiPriority = 0, | ||
.txPin = CC1310_LAUNCHXL_UART_TX, | ||
.rxPin = CC1310_LAUNCHXL_UART_RX, | ||
.ctsPin = PIN_UNASSIGNED, | ||
.rtsPin = PIN_UNASSIGNED, | ||
.ringBufPtr = uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0], | ||
.ringBufSize = sizeof(uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0]) | ||
} | ||
}; | ||
|
||
const UART_Config UART_config[CC1310_LAUNCHXL_UARTCOUNT] = { | ||
{ | ||
.fxnTablePtr = &UARTCC26XX_fxnTable, | ||
.object = &uartCC26XXObjects[CC1310_LAUNCHXL_UART0], | ||
.hwAttrs = &uartCC26XXHWAttrs[CC1310_LAUNCHXL_UART0] | ||
}, | ||
}; | ||
|
||
const uint_least8_t UART_count = CC1310_LAUNCHXL_UARTCOUNT; | ||
|
||
/* | ||
* =============================== Watchdog =============================== | ||
*/ | ||
#include <ti/drivers/Watchdog.h> | ||
#include <ti/drivers/watchdog/WatchdogCC26XX.h> | ||
|
||
WatchdogCC26XX_Object watchdogCC26XXObjects[CC1310_LAUNCHXL_WATCHDOGCOUNT]; | ||
|
||
const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1310_LAUNCHXL_WATCHDOGCOUNT] = { | ||
{ | ||
.baseAddr = WDT_BASE, | ||
.reloadValue = 1000 /* Reload value in milliseconds */ | ||
}, | ||
}; | ||
|
||
const Watchdog_Config Watchdog_config[CC1310_LAUNCHXL_WATCHDOGCOUNT] = { | ||
{ | ||
.fxnTablePtr = &WatchdogCC26XX_fxnTable, | ||
.object = &watchdogCC26XXObjects[CC1310_LAUNCHXL_WATCHDOG0], | ||
.hwAttrs = &watchdogCC26XXHWAttrs[CC1310_LAUNCHXL_WATCHDOG0] | ||
}, | ||
}; | ||
|
||
const uint_least8_t Watchdog_count = CC1310_LAUNCHXL_WATCHDOGCOUNT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.