浏览代码

Remane addStorage to addMemory

teensy4-core
PaulStoffregen 4 年前
父节点
当前提交
ec13d5b31a
共有 3 个文件被更改,包括 12 次插入4 次删除
  1. +2
    -0
      keywords.txt
  2. +2
    -2
      teensy4/HardwareSerial.cpp
  3. +8
    -2
      teensy4/HardwareSerial.h

+ 2
- 0
keywords.txt 查看文件

@@ -46,6 +46,8 @@ SerialUSB2 KEYWORD1
setRX KEYWORD2
setTX KEYWORD2
write9bit KEYWORD2
addMemoryForRead KEYWORD2
addMemoryForWrite KEYWORD2
clear KEYWORD2
EventResponder LITERAL1
EventResponderRef LITERAL1

+ 2
- 2
teensy4/HardwareSerial.cpp 查看文件

@@ -412,7 +412,7 @@ int HardwareSerial::available(void)
return avail;
}

void HardwareSerial::addStorageForRead(void *buffer, size_t length)
void HardwareSerial::addMemoryForRead(void *buffer, size_t length)
{
rx_buffer_storage_ = (BUFTYPE*)buffer;
if (buffer) {
@@ -425,7 +425,7 @@ void HardwareSerial::addStorageForRead(void *buffer, size_t length)
rts_high_watermark_ = rx_buffer_total_size_ - hardware->rts_high_watermark;
}

void HardwareSerial::addStorageForWrite(void *buffer, size_t length)
void HardwareSerial::addMemoryForWrite(void *buffer, size_t length)
{
tx_buffer_storage_ = (BUFTYPE*)buffer;
if (buffer) {

+ 8
- 2
teensy4/HardwareSerial.h 查看文件

@@ -195,8 +195,14 @@ public:
bool attachCts(uint8_t pin);
void clear(void);
int availableForWrite(void);
void addStorageForRead(void *buffer, size_t length);
void addStorageForWrite(void *buffer, size_t length);
void addMemoryForRead(void *buffer, size_t length);
void addMemoryForWrite(void *buffer, size_t length);
void addStorageForRead(void *buffer, size_t length) __attribute__((deprecated("addStorageForRead was renamed to addMemoryForRead"))){
addMemoryForRead(buffer, length);
}
void addStorageForWrite(void *buffer, size_t length) __attribute__((deprecated("addStorageForWrite was renamed to addMemoryForWrite"))){
addMemoryForWrite(buffer, length);
}
size_t write9bit(uint32_t c);
// Event Handler functions and data

正在加载...
取消
保存