Skip to content

Commit 22f2e22

Browse files
committed
lpc175x added missing -1 in burst size calculation
1 parent 870875a commit 22f2e22

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

targets/core/nxp/lpc175x/dma.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace klib::core::lpc175x::io::detail::dma {
6262
// check if the current value matches the burst size
6363
// from the data
6464
if (size >= values[i - 1]) {
65-
return i;
65+
return i - 1;
6666
}
6767
}
6868

@@ -103,7 +103,7 @@ namespace klib::core::lpc175x::io::detail::dma {
103103
// check if the current value matches the burst size
104104
// from the data
105105
if (size >= values[i - 1]) {
106-
return i;
106+
return i - 1;
107107
}
108108
}
109109

@@ -293,13 +293,13 @@ namespace klib::core::lpc175x::io {
293293
// enable dma on the source peripheral
294294
if constexpr (!std::is_same_v<Source, klib::io::dma::memory>) {
295295
// enable the dma on the source
296-
Source::template dma_enable<true, 1>();
296+
Source::template dma_enable<true, true>();
297297
}
298298

299299
// enable dma on the destination peripheral
300300
if constexpr (!std::is_same_v<Destination, klib::io::dma::memory>) {
301301
// enable the dma on the destination
302-
Destination::template dma_enable<true, 0>();
302+
Destination::template dma_enable<true, false>();
303303
}
304304

305305
// register our irq handler for the current channel

0 commit comments

Comments
 (0)