Skip to content

Commit c9fa287

Browse files
committed
lpx175x changed helper data to not be const ptr
1 parent 8616a0c commit c9fa287

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

targets/core/nxp/lpc175x/dma.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace klib::core::lpc175x::io::detail::dma {
3535
*/
3636
struct transfer_helper {
3737
// pointer to the start of the data
38-
const uint8_t* data;
38+
uint8_t* data;
3939

4040
// requested size of the current endpoint
4141
uint32_t requested_size;
@@ -326,7 +326,9 @@ namespace klib::core::lpc175x::io {
326326
Dma::port->CH[Channel].DESTADDR = reinterpret_cast<uint32_t>(Destination::template dma_data<0>());
327327

328328
// update the helper data with the information about the transfer
329-
helper.data = reinterpret_cast<const uint8_t*>(source.data());
329+
// we know we are not writing to it so we can remove the const here
330+
// for the helper data
331+
helper.data = const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(source.data()));
330332
helper.requested_size = size;
331333
helper.transferred_size = 0x00;
332334
helper.callback = callback;
@@ -380,7 +382,7 @@ namespace klib::core::lpc175x::io {
380382
Dma::port->CH[Channel].SRCADDR = reinterpret_cast<uint32_t>(Source::template dma_data<1>());
381383

382384
// update the helper data with the information about the transfer
383-
helper.data = reinterpret_cast<const uint8_t*>(destination.data());
385+
helper.data = reinterpret_cast<uint8_t*>(destination.data());
384386
helper.requested_size = size;
385387
helper.transferred_size = 0x00;
386388
helper.callback = callback;

0 commit comments

Comments
 (0)