diff options
author | gdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01> | 2018-12-15 17:50:05 +0000 |
---|---|---|
committer | gdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01> | 2018-12-15 17:50:05 +0000 |
commit | f20ecc78178fc8cdfa682e100398c240224dbb4a (patch) | |
tree | 64272a45778baea1c1deed82d9223c3ddc87f6e7 /testhal | |
parent | 984f865b45b110915616c3c9629fe47b064bed99 (diff) | |
download | ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.tar.gz ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.tar.bz2 ChibiOS-f20ecc78178fc8cdfa682e100398c240224dbb4a.zip |
HAL callbacks rework.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12470 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32F0xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F1xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F37x/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F37x/SDADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/ADC_DUAL/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/DAC/main.c | 10 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/DAC/main.c | 10 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/DAC_DUAL/main.c | 10 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/I2S/main.c | 13 | ||||
-rw-r--r-- | testhal/STM32/STM32F7xx/GPT-ADC/main.c | 10 | ||||
-rw-r--r-- | testhal/STM32/STM32L0xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32L1xx/ADC/main.c | 9 | ||||
-rw-r--r-- | testhal/STM32/STM32L4xx/ADC/Makefile | 2 | ||||
-rw-r--r-- | testhal/STM32/STM32L4xx/ADC/debug/STM32L4xx-ADC (OpenOCD, Flash and Run).launch | 104 | ||||
-rw-r--r-- | testhal/STM32/STM32L4xx/ADC/main.c | 11 | ||||
-rw-r--r-- | testhal/STM32/multi/DAC/main.c | 10 | ||||
-rwxr-xr-x | testhal/STM32/multi/SPI/main.c | 2 |
19 files changed, 123 insertions, 140 deletions
diff --git a/testhal/STM32/STM32F0xx/ADC/main.c b/testhal/STM32/STM32F0xx/ADC/main.c index b7cf2bbde..109150b6a 100644 --- a/testhal/STM32/STM32F0xx/ADC/main.c +++ b/testhal/STM32/STM32F0xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F1xx/ADC/main.c b/testhal/STM32/STM32F1xx/ADC/main.c index 32e5b82a8..fa466c2fa 100644 --- a/testhal/STM32/STM32F1xx/ADC/main.c +++ b/testhal/STM32/STM32F1xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F37x/ADC/main.c b/testhal/STM32/STM32F37x/ADC/main.c index ca5e5feb4..6beb00cdb 100644 --- a/testhal/STM32/STM32F37x/ADC/main.c +++ b/testhal/STM32/STM32F37x/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F37x/SDADC/main.c b/testhal/STM32/STM32F37x/SDADC/main.c index 74cb4eb50..47b4aa2a5 100644 --- a/testhal/STM32/STM32F37x/SDADC/main.c +++ b/testhal/STM32/STM32F37x/SDADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F3xx/ADC/main.c b/testhal/STM32/STM32F3xx/ADC/main.c index a6659f4e8..9305f505b 100644 --- a/testhal/STM32/STM32F3xx/ADC/main.c +++ b/testhal/STM32/STM32F3xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F3xx/ADC_DUAL/main.c b/testhal/STM32/STM32F3xx/ADC_DUAL/main.c index e8eadbeb7..6518965c8 100644 --- a/testhal/STM32/STM32F3xx/ADC_DUAL/main.c +++ b/testhal/STM32/STM32F3xx/ADC_DUAL/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F3xx/DAC/main.c b/testhal/STM32/STM32F3xx/DAC/main.c index aa791bf82..74491a0d0 100644 --- a/testhal/STM32/STM32F3xx/DAC/main.c +++ b/testhal/STM32/STM32F3xx/DAC/main.c @@ -59,16 +59,14 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { * DAC streaming callback.
*/
size_t nx = 0, ny = 0, nz = 0;
-static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) {
-
- (void)dacp;
+static void end_cb1(DACDriver *dacp) {
nz++;
- if (dac_buffer == buffer) {
- nx += n;
+ if (dacIsBufferComplete(dacp)) {
+ nx += DAC_BUFFER_SIZE / 2;
}
else {
- ny += n;
+ ny += DAC_BUFFER_SIZE / 2;
}
if ((nz % 1000) == 0) {
diff --git a/testhal/STM32/STM32F4xx/ADC/main.c b/testhal/STM32/STM32F4xx/ADC/main.c index 8477a0ab1..27fff6839 100644 --- a/testhal/STM32/STM32F4xx/ADC/main.c +++ b/testhal/STM32/STM32F4xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32F4xx/DAC/main.c b/testhal/STM32/STM32F4xx/DAC/main.c index 4b038ea72..d4844441e 100644 --- a/testhal/STM32/STM32F4xx/DAC/main.c +++ b/testhal/STM32/STM32F4xx/DAC/main.c @@ -59,16 +59,14 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { * DAC streaming callback.
*/
size_t nx = 0, ny = 0, nz = 0;
-static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) {
-
- (void)dacp;
+static void end_cb1(DACDriver *dacp) {
nz++;
- if (dac_buffer == buffer) {
- nx += n;
+ if (dacIsBufferComplete(dacp)) {
+ nx += DAC_BUFFER_SIZE / 2;
}
else {
- ny += n;
+ ny += DAC_BUFFER_SIZE / 2;
}
if ((nz % 1000) == 0) {
diff --git a/testhal/STM32/STM32F4xx/DAC_DUAL/main.c b/testhal/STM32/STM32F4xx/DAC_DUAL/main.c index 652441efd..b39fa5913 100644 --- a/testhal/STM32/STM32F4xx/DAC_DUAL/main.c +++ b/testhal/STM32/STM32F4xx/DAC_DUAL/main.c @@ -59,16 +59,14 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { * DAC streaming callback.
*/
size_t nx = 0, ny = 0, nz = 0;
-static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) {
-
- (void)dacp;
+static void end_cb1(DACDriver *dacp) {
nz++;
- if (dac_buffer == buffer) {
- nx += n;
+ if (dacIsBufferComplete(dacp)) {
+ nx += DAC_BUFFER_SIZE / 2;
}
else {
- ny += n;
+ ny += DAC_BUFFER_SIZE / 2;
}
if ((nz % 1000) == 0) {
diff --git a/testhal/STM32/STM32F4xx/I2S/main.c b/testhal/STM32/STM32F4xx/I2S/main.c index 7eaa1b075..6a5e0a236 100644 --- a/testhal/STM32/STM32F4xx/I2S/main.c +++ b/testhal/STM32/STM32F4xx/I2S/main.c @@ -21,7 +21,7 @@ static uint16_t i2s_rx_buf[I2S_BUF_SIZE];
-static void i2scallback(I2SDriver *i2sp, size_t offset, size_t n);
+static void i2scallback(I2SDriver *i2sp);
static const I2SConfig i2scfg = {
NULL,
@@ -32,11 +32,14 @@ static const I2SConfig i2scfg = { 16
};
-static void i2scallback(I2SDriver *i2sp, size_t offset, size_t n) {
+static void i2scallback(I2SDriver *i2sp) {
- (void)i2sp;
- (void)offset;
- (void)n;
+ if (i2sIsBufferComplete(i2sp)) {
+ /* 2nd buffer half processing.*/
+ }
+ else {
+ /* 1st buffer half processing.*/
+ }
}
/*
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC/main.c b/testhal/STM32/STM32F7xx/GPT-ADC/main.c index 92a7da91c..d013a2354 100644 --- a/testhal/STM32/STM32F7xx/GPT-ADC/main.c +++ b/testhal/STM32/STM32F7xx/GPT-ADC/main.c @@ -57,7 +57,7 @@ static adcsample_t samples1[ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
#if !DMA_BUFFERS_COHERENCE
/* DMA buffer invalidation because data cache, only invalidating the
@@ -65,16 +65,14 @@ static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) { Only required if the ADC buffer is placed in a cache-able area.*/
dmaBufferInvalidate(buffer,
n * adcp->grpp->num_channels * sizeof (adcsample_t));
-#else
- (void)adcp;
#endif
/* Updating counters.*/
- if (samples1 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32L0xx/ADC/main.c b/testhal/STM32/STM32L0xx/ADC/main.c index 0c0c8eaaf..a4c33cab2 100644 --- a/testhal/STM32/STM32L0xx/ADC/main.c +++ b/testhal/STM32/STM32L0xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32L1xx/ADC/main.c b/testhal/STM32/STM32L1xx/ADC/main.c index 79305dafc..f01da1d3c 100644 --- a/testhal/STM32/STM32L1xx/ADC/main.c +++ b/testhal/STM32/STM32L1xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
diff --git a/testhal/STM32/STM32L4xx/ADC/Makefile b/testhal/STM32/STM32L4xx/ADC/Makefile index 402c1ce74..8c74815fd 100644 --- a/testhal/STM32/STM32L4xx/ADC/Makefile +++ b/testhal/STM32/STM32L4xx/ADC/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32L4xx/ADC/debug/STM32L4xx-ADC (OpenOCD, Flash and Run).launch b/testhal/STM32/STM32L4xx/ADC/debug/STM32L4xx-ADC (OpenOCD, Flash and Run).launch index 89c0ca557..f752b6269 100644 --- a/testhal/STM32/STM32L4xx/ADC/debug/STM32L4xx-ADC (OpenOCD, Flash and Run).launch +++ b/testhal/STM32/STM32L4xx/ADC/debug/STM32L4xx-ADC (OpenOCD, Flash and Run).launch @@ -1,52 +1,52 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
-<stringAttribute key="bad_container_name" value="\STM32L4xx-ADC\debug"/>
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50 "/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
-<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
-<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
-<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
-<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList/>"/>
-<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
-<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32L4xx-ADC"/>
-<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.1093754934"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/STM32L4xx-ADC"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</listAttribute>
-</launchConfiguration>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"> +<stringAttribute key="bad_container_name" value="\STM32L4xx-ADC\debug"/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50 "/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> +<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> +<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> +<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> +<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> +<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList/>"/> +<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/> +<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32L4xx-ADC"/> +<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.1093754934"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/STM32L4xx-ADC"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> +</listAttribute> +</launchConfiguration> diff --git a/testhal/STM32/STM32L4xx/ADC/main.c b/testhal/STM32/STM32L4xx/ADC/main.c index 95b211f58..e86cefa2a 100644 --- a/testhal/STM32/STM32L4xx/ADC/main.c +++ b/testhal/STM32/STM32L4xx/ADC/main.c @@ -30,14 +30,13 @@ static adcsample_t samples2[ADC_GRP2_NUM_CHANNELS * ADC_GRP2_BUF_DEPTH]; * ADC streaming callback.
*/
size_t nx = 0, ny = 0;
-static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+static void adccallback(ADCDriver *adcp) {
- (void)adcp;
- if (samples2 == buffer) {
- nx += n;
+ if (adcIsBufferComplete(adcp)) {
+ nx += 1;
}
else {
- ny += n;
+ ny += 1;
}
}
@@ -161,7 +160,7 @@ int main(void) { * Normal main() thread activity, in this demo it does nothing.
*/
while (true) {
- if (palReadPad(GPIOC, GPIOC_BUTTON)) {
+ if (!palReadPad(GPIOC, GPIOC_BUTTON)) {
adcStopConversion(&ADCD1);
}
chThdSleepMilliseconds(500);
diff --git a/testhal/STM32/multi/DAC/main.c b/testhal/STM32/multi/DAC/main.c index e8643c183..08786f002 100644 --- a/testhal/STM32/multi/DAC/main.c +++ b/testhal/STM32/multi/DAC/main.c @@ -61,16 +61,14 @@ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { * DAC streaming callback.
*/
size_t nx = 0, ny = 0, nz = 0;
-static void end_cb1(DACDriver *dacp, dacsample_t *buffer, size_t n) {
-
- (void)dacp;
+static void end_cb1(DACDriver *dacp) {
nz++;
- if (dac_buffer == buffer) {
- nx += n;
+ if (dacIsBufferComplete(dacp)) {
+ nx += DAC_BUFFER_SIZE / 2;
}
else {
- ny += n;
+ ny += DAC_BUFFER_SIZE / 2;
}
if ((nz % 1000) == 0) {
diff --git a/testhal/STM32/multi/SPI/main.c b/testhal/STM32/multi/SPI/main.c index aa8d9bb33..96e2ee154 100755 --- a/testhal/STM32/multi/SPI/main.c +++ b/testhal/STM32/multi/SPI/main.c @@ -32,7 +32,7 @@ CC_ALIGN(32) static uint8_t rxbuf[512]; */
void spi_circular_cb(SPIDriver *spip) {
- if(spip->state == SPI_COMPLETE) {
+ if (spiIsBufferComplete(spip)) {
/* 2nd half.*/
palWriteLine(PORTAB_LINE_LED1, PORTAB_LED_OFF);
}
|