瀏覽代碼

Merge pull request #33 from crteensy/patch-1

Update DMAChannel.h
main
Paul Stoffregen 10 年之前
父節點
當前提交
861f2fd6ec
共有 1 個檔案被更改,包括 6 行新增6 行删除
  1. +6
    -6
      teensy3/DMAChannel.h

+ 6
- 6
teensy3/DMAChannel.h 查看文件

@@ -53,7 +53,7 @@ public:
TCD->SADDR = &p;
TCD->SOFF = 0;
TCD->ATTR_SRC = 0;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 1;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 1;
TCD->SLAST = 0;
}
void source(volatile const signed short &p) { source(*(volatile const uint16_t *)&p); }
@@ -61,7 +61,7 @@ public:
TCD->SADDR = &p;
TCD->SOFF = 0;
TCD->ATTR_SRC = 1;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 2;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 2;
TCD->SLAST = 0;
}
void source(volatile const signed int &p) { source(*(volatile const uint32_t *)&p); }
@@ -71,7 +71,7 @@ public:
TCD->SADDR = &p;
TCD->SOFF = 0;
TCD->ATTR_SRC = 2;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 4;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 4;
TCD->SLAST = 0;
}

@@ -161,7 +161,7 @@ public:
TCD->DADDR = &p;
TCD->DOFF = 0;
TCD->ATTR_DST = 0;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 1;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 1;
TCD->DLASTSGA = 0;
}
void destination(volatile signed short &p) { destination(*(volatile uint16_t *)&p); }
@@ -169,7 +169,7 @@ public:
TCD->DADDR = &p;
TCD->DOFF = 0;
TCD->ATTR_DST = 1;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 2;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 2;
TCD->DLASTSGA = 0;
}
void destination(volatile signed int &p) { destination(*(volatile uint32_t *)&p); }
@@ -179,7 +179,7 @@ public:
TCD->DADDR = &p;
TCD->DOFF = 0;
TCD->ATTR_DST = 2;
if ((uint32_t)p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 4;
if ((uint32_t)&p < 0x40000000 || TCD->NBYTES == 0) TCD->NBYTES = 4;
TCD->DLASTSGA = 0;
}


Loading…
取消
儲存