Skip to content

Commit 5a4ce3c

Browse files
committed
Merge branch 'master' of https://github.com/mbedmicro/mbed
2 parents f34ee0d + 6b2cd33 commit 5a4ce3c

File tree

16 files changed

+68
-48
lines changed

16 files changed

+68
-48
lines changed

libraries/mbed/api/I2C.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class I2C {
149149
* @param repeated Repeated start, true - do not send stop at end
150150
* @return Zero if the transfer has started, or -1 if I2C peripheral is busy
151151
*/
152-
int transfer(int address, char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false);
152+
int transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false);
153153

154154
/** Abort the on-going I2C transfer
155155
*/

libraries/mbed/api/SPI.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class SPI {
123123
* @param event The logical OR of events to modify
124124
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
125125
*/
126-
virtual int transfer(uint8_t *tx_buffer, int tx_length, uint8_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
126+
virtual int transfer(const uint8_t *tx_buffer, int tx_length, uint8_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
127127
return transfer(tx_buffer, tx_length, rx_buffer, rx_length, 8, callback, event);
128128
}
129129

@@ -139,7 +139,7 @@ class SPI {
139139
* @param event The logical OR of events to modify
140140
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
141141
*/
142-
virtual int transfer(uint16_t *tx_buffer, int tx_length, uint16_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
142+
virtual int transfer(const uint16_t *tx_buffer, int tx_length, uint16_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
143143
return transfer(tx_buffer, tx_length, rx_buffer, rx_length, 16, callback, event);
144144
}
145145

@@ -155,7 +155,7 @@ class SPI {
155155
* @param event The logical OR of events to modify
156156
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
157157
*/
158-
virtual int transfer(uint32_t *tx_buffer, int tx_length, uint32_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
158+
virtual int transfer(const uint32_t *tx_buffer, int tx_length, uint32_t *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
159159
return transfer((void *)tx_buffer, tx_length, (void *)rx_buffer, rx_length, 32, callback, event);
160160
}
161161

@@ -197,7 +197,7 @@ class SPI {
197197
* @param event The logical OR of events to modify
198198
* @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full
199199
*/
200-
int transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
200+
int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
201201

202202
/**
203203
*
@@ -212,7 +212,7 @@ class SPI {
212212
* @param event The logical OR of events to modify
213213
* @return Zero if a transfer was added to the queue, or -1 if the queue is full
214214
*/
215-
int queue_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
215+
int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
216216

217217
/** Configures a callback, spi peripheral and initiate a new transfer
218218
*
@@ -226,7 +226,7 @@ class SPI {
226226
* @param callback The event callback function
227227
* @param event The logical OR of events to modify
228228
*/
229-
void start_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
229+
void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
230230

231231
#if TRANSACTION_QUEUE_SIZE_SPI
232232

libraries/mbed/api/SerialBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class SerialBase {
135135
* @param callback The event callback function
136136
* @param event The logical OR of TX events
137137
*/
138-
int write(uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
138+
int write(const uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
139139

140140
/** Begin asynchronous write using 16bit buffer. The completition invokes registered TX event callback
141141
*
@@ -144,7 +144,7 @@ class SerialBase {
144144
* @param callback The event callback function
145145
* @param event The logical OR of TX events
146146
*/
147-
int write(uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
147+
int write(const uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
148148

149149
/** Abort the on-going write transfer
150150
*/
@@ -190,7 +190,7 @@ class SerialBase {
190190

191191
protected:
192192
void start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event, unsigned char char_match);
193-
void start_write(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event);
193+
void start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event);
194194
void interrupt_handler_asynch(void);
195195
#endif
196196

libraries/mbed/api/mbed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef MBED_H
1717
#define MBED_H
1818

19-
#define MBED_LIBRARY_VERSION 100
19+
#define MBED_LIBRARY_VERSION 101
2020

2121
#include "platform.h"
2222

libraries/mbed/common/I2C.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void I2C::stop(void) {
9292

9393
#if DEVICE_I2C_ASYNCH
9494

95-
int I2C::transfer(int address, char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event, bool repeated)
95+
int I2C::transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event, bool repeated)
9696
{
9797
if (i2c_active(&_i2c)) {
9898
return -1; // transaction ongoing

libraries/mbed/common/SPI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int SPI::write(int value) {
6868

6969
#if DEVICE_SPI_ASYNCH
7070

71-
int SPI::transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
71+
int SPI::transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
7272
{
7373
if (spi_active(&_spi)) {
7474
return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, bit_width, callback, event);
@@ -108,12 +108,12 @@ int SPI::set_dma_usage(DMAUsage usage)
108108
return 0;
109109
}
110110

111-
int SPI::queue_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
111+
int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
112112
{
113113
#if TRANSACTION_QUEUE_SIZE_SPI
114114
transaction_t t;
115115

116-
t.tx_buffer = tx_buffer;
116+
t.tx_buffer = const_cast<void *>(tx_buffer);
117117
t.tx_length = tx_length;
118118
t.rx_buffer = rx_buffer;
119119
t.rx_length = rx_length;
@@ -132,7 +132,7 @@ int SPI::queue_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_
132132
#endif
133133
}
134134

135-
void SPI::start_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
135+
void SPI::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
136136
{
137137
aquire();
138138
_callback = callback;

libraries/mbed/common/SerialBase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) {
110110

111111
#if DEVICE_SERIAL_ASYNCH
112112

113-
int SerialBase::write(uint8_t *buffer, int length, const event_callback_t& callback, int event)
113+
int SerialBase::write(const uint8_t *buffer, int length, const event_callback_t& callback, int event)
114114
{
115115
if (serial_tx_active(&_serial)) {
116116
return -1; // transaction ongoing
@@ -119,7 +119,7 @@ int SerialBase::write(uint8_t *buffer, int length, const event_callback_t& callb
119119
return 0;
120120
}
121121

122-
int SerialBase::write(uint16_t *buffer, int length, const event_callback_t& callback, int event)
122+
int SerialBase::write(const uint16_t *buffer, int length, const event_callback_t& callback, int event)
123123
{
124124
if (serial_tx_active(&_serial)) {
125125
return -1; // transaction ongoing
@@ -128,7 +128,7 @@ int SerialBase::write(uint16_t *buffer, int length, const event_callback_t& call
128128
return 0;
129129
}
130130

131-
void SerialBase::start_write(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event)
131+
void SerialBase::start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event)
132132
{
133133
_tx_callback = callback;
134134

libraries/mbed/hal/i2c_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask);
191191
* @param handler The I2C IRQ handler to be set
192192
* @param hint DMA hint usage
193193
*/
194-
void i2c_transfer_asynch(i2c_t *obj, void *tx, size_t tx_length, void *rx, size_t rx_length, uint32_t address, uint32_t stop, uint32_t handler, uint32_t event, DMAUsage hint);
194+
void i2c_transfer_asynch(i2c_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint32_t address, uint32_t stop, uint32_t handler, uint32_t event, DMAUsage hint);
195195

196196
/** The asynchronous IRQ handler
197197
* @param obj The I2C object which holds the transfer information

libraries/mbed/hal/serial_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
237237
* @param hint A suggestion for how to use DMA with this transfer
238238
* @return Returns number of data transfered, or 0 otherwise
239239
*/
240-
int serial_tx_asynch(serial_t *obj, void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint);
240+
int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint);
241241

242242
/** Begin asynchronous RX transfer (enable interrupt for data collecting)
243243
* The used buffer is specified in the serial object - rx_buff

libraries/mbed/hal/spi_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ uint8_t spi_get_module(spi_t *obj);
169169
* @param[in] handler SPI interrupt handler
170170
* @param[in] hint A suggestion for how to use DMA with this transfer
171171
*/
172-
void spi_master_transfer(spi_t *obj, void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint);
172+
void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint);
173173

174174
/** The asynchronous IRQ handler
175175
*

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask)
426426
* @param handler The I2C IRQ handler to be set
427427
* @param hint DMA hint usage
428428
*/
429-
void i2c_transfer_asynch(i2c_t *obj, void *tx, size_t tx_length, void *rx, size_t rx_length, uint32_t address, uint32_t stop, uint32_t handler, uint32_t event, DMAUsage hint)
429+
void i2c_transfer_asynch(i2c_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint32_t address, uint32_t stop, uint32_t handler, uint32_t event, DMAUsage hint)
430430
{
431431
I2C_TransferReturn_TypeDef retval;
432432
if(i2c_active(obj)) return;
@@ -440,7 +440,7 @@ void i2c_transfer_asynch(i2c_t *obj, void *tx, size_t tx_length, void *rx, size_
440440
if((tx_length > 0) && (rx_length == 0)) {
441441
obj->i2c.xfer.flags = I2C_FLAG_WRITE;
442442
//Store buffer info
443-
obj->i2c.xfer.buf[0].data = tx;
443+
obj->i2c.xfer.buf[0].data = (void *)tx;
444444
obj->i2c.xfer.buf[0].len = (uint16_t) tx_length;
445445
} else if ((tx_length == 0) && (rx_length > 0)) {
446446
obj->i2c.xfer.flags = I2C_FLAG_READ;
@@ -450,7 +450,7 @@ void i2c_transfer_asynch(i2c_t *obj, void *tx, size_t tx_length, void *rx, size_
450450
} else if ((tx_length > 0) && (rx_length > 0)) {
451451
obj->i2c.xfer.flags = I2C_FLAG_WRITE_READ;
452452
//Store buffer info
453-
obj->i2c.xfer.buf[0].data = tx;
453+
obj->i2c.xfer.buf[0].data = (void *)tx;
454454
obj->i2c.xfer.buf[0].len = (uint16_t) tx_length;
455455
obj->i2c.xfer.buf[1].data = rx;
456456
obj->i2c.xfer.buf[1].len = (uint16_t) rx_length;

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,14 +1262,14 @@ void serial_set_char_match(serial_t *obj, uint8_t char_match)
12621262
* @param hint A suggestion for how to use DMA with this transfer
12631263
* @return Returns number of data transfered, or 0 otherwise
12641264
*/
1265-
int serial_tx_asynch(serial_t *obj, void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint)
1265+
int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint)
12661266
{
12671267
// Check that a buffer has indeed been set up
12681268
MBED_ASSERT(tx != (void*)0);
12691269
if(tx_length == 0) return 0;
12701270

12711271
// Set up buffer
1272-
serial_tx_buffer_set(obj, tx, tx_length, tx_width);
1272+
serial_tx_buffer_set(obj, (void *)tx, tx_length, tx_width);
12731273

12741274
// Set up events
12751275
serial_tx_enable_event(obj, SERIAL_EVENT_TX_ALL, false);

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/spi_api.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,15 @@ uint8_t spi_active(spi_t *obj)
399399
}
400400
}
401401

402-
void spi_buffer_set(spi_t *obj, void *tx, uint32_t tx_length, void *rx, uint32_t rx_length, uint8_t bit_width)
402+
void spi_buffer_set(spi_t *obj, const void *tx, uint32_t tx_length, void *rx, uint32_t rx_length, uint8_t bit_width)
403403
{
404404
uint32_t i;
405405
uint16_t *tx_ptr = (uint16_t *) tx;
406406

407407
tx_length *= (bit_width >> 3);
408408
rx_length *= (bit_width >> 3);
409409

410-
obj->tx_buff.buffer = tx;
410+
obj->tx_buff.buffer = (void *)tx;
411411
obj->rx_buff.buffer = rx;
412412
obj->tx_buff.length = tx_length;
413413
obj->rx_buff.length = rx_length;
@@ -761,7 +761,7 @@ static void spi_master_dma_channel_setup(spi_t *obj, void* callback)
761761
* * tx_length: how many bytes will get sent.
762762
* * rx_length: how many bytes will get received. If > tx_length, TX will get padded with n lower bits of SPI_FILL_WORD.
763763
******************************************/
764-
static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_length, int rx_length)
764+
static void spi_activate_dma(spi_t *obj, void* rxdata, const void* txdata, int tx_length, int rx_length)
765765
{
766766
/* DMA descriptors */
767767
DMA_CfgDescr_TypeDef rxDescrCfg;
@@ -822,7 +822,7 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_leng
822822
true,
823823
false,
824824
(obj->spi.bits <= 8 ? (void *)&(obj->spi.spi->TXDATA) : (void *)&(obj->spi.spi->TXDOUBLE)), //When frame size > 9, point to TXDOUBLE
825-
(txdata == 0 ? &fill_word : txdata), // When there is nothing to transmit, point to static fill word
825+
(txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
826826
(obj->spi.bits <= 8 ? tx_length - 1 : (tx_length / 2) - 1)); // When using TXDOUBLE, recalculate transfer length
827827
} else {
828828
/* Frame size == 9 */
@@ -860,7 +860,7 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_leng
860860
true,
861861
false,
862862
(void *)&(obj->spi.spi->TXDATAX), //When frame size > 9, point to TXDOUBLE
863-
(txdata == 0 ? &fill_word : txdata), // When there is nothing to transmit, point to static fill word
863+
(txdata == 0 ? &fill_word : (void *)txdata), // When there is nothing to transmit, point to static fill word
864864
(tx_length / 2) - 1); // When using TXDOUBLE, recalculate transfer length
865865
}
866866
}
@@ -882,7 +882,7 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_leng
882882
* If the previous transfer has kept the channel, that channel will continue to get used.
883883
*
884884
********************************************************************/
885-
void spi_master_transfer_dma(spi_t *obj, void *txdata, void *rxdata, int tx_length, int rx_length, void* cb, DMAUsage hint)
885+
void spi_master_transfer_dma(spi_t *obj, const void *txdata, void *rxdata, int tx_length, int rx_length, void* cb, DMAUsage hint)
886886
{
887887
/* Init DMA here to include it in the power figure */
888888
dma_init();
@@ -930,7 +930,7 @@ void spi_master_transfer_dma(spi_t *obj, void *txdata, void *rxdata, int tx_leng
930930
* @param[in] handler SPI interrupt handler
931931
* @param[in] hint A suggestion for how to use DMA with this transfer
932932
*/
933-
void spi_master_transfer(spi_t *obj, void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint)
933+
void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint)
934934
{
935935
if( spi_active(obj) ) return;
936936

workspace_tools/build_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
('MAXWSNENV', ('ARM', 'GCC_ARM', 'IAR')),
106106
('MAX32600MBED', ('ARM', 'GCC_ARM', 'IAR')),
107107

108-
('WIZwiki_W7500', ('ARM', 'uARM')),
108+
('WIZWIKI_W7500', ('ARM', 'uARM')),
109109
)
110110

111111

workspace_tools/singletest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def get_version():
231231
_opts_mut_reset_type=opts.mut_reset_type,
232232
_opts_jobs=opts.jobs,
233233
_opts_waterfall_test=opts.waterfall_test,
234+
_opts_consolidate_waterfall_test=opts.consolidate_waterfall_test,
234235
_opts_extend_test_timeout=opts.extend_test_timeout)
235236

236237
# Runs test suite in CLI mode

0 commit comments

Comments
 (0)