Index: platforms/stm/disco_dartino/src/uart.cc |
diff --git a/platforms/stm/disco_fletch/src/uart.cc b/platforms/stm/disco_dartino/src/uart.cc |
similarity index 91% |
rename from platforms/stm/disco_fletch/src/uart.cc |
rename to platforms/stm/disco_dartino/src/uart.cc |
index f20f0d586f83f5b7f9e91f2d193aacf84a168725..11e2d5504dc9e47adf895d2462d56e7312431e1a 100644 |
--- a/platforms/stm/disco_fletch/src/uart.cc |
+++ b/platforms/stm/disco_dartino/src/uart.cc |
@@ -2,7 +2,7 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE.md file. |
-#include "platforms/stm/disco_fletch/src/uart.h" |
+#include "platforms/stm/disco_dartino/src/uart.h" |
#include <stdlib.h> |
@@ -23,7 +23,7 @@ static uint32_t error = 0; |
const int kReceivedBit = 1 << 0; |
const int kTransmittedBit = 1 << 1; |
const int kErrorBit = 1 << 2; |
-static fletch::Atomic<uint32_t> interrupt_flags; |
+static dartino::Atomic<uint32_t> interrupt_flags; |
const int kRxBufferSize = 511; |
const int kTxBufferSize = 511; |
@@ -37,7 +37,7 @@ void __UartTask(void const* argument) { |
Uart::Uart() { |
uart_ = &huart1; |
rx_buffer_ = new CircularBuffer(kRxBufferSize); |
- tx_mutex_ = fletch::Platform::CreateMutex(); |
+ tx_mutex_ = dartino::Platform::CreateMutex(); |
tx_buffer_ = new CircularBuffer(kTxBufferSize); |
tx_pending_ = false; |
error_count_ = 0; |
@@ -66,7 +66,7 @@ size_t Uart::Read(uint8_t* buffer, size_t count) { |
size_t Uart::Write(const uint8_t* buffer, size_t count) { |
size_t written = tx_buffer_->Write(buffer, count, CircularBuffer::kBlock); |
- fletch::ScopedLock lock(tx_mutex_); |
+ dartino::ScopedLock lock(tx_mutex_); |
EnsureTransmission(); |
return written; |
} |
@@ -87,12 +87,12 @@ void Uart::Task() { |
// Start receiving of next byte. |
HAL_StatusTypeDef status = HAL_UART_Receive_IT(uart_, &rx_data_, 1); |
if (status != HAL_OK) { |
- fletch::Print::Error("HAL_UART_Receive_IT returned %d\n", status); |
+ dartino::Print::Error("HAL_UART_Receive_IT returned %d\n", status); |
} |
} |
if ((flags & kTransmittedBit) != 0) { |
- fletch::ScopedLock lock(tx_mutex_); |
+ dartino::ScopedLock lock(tx_mutex_); |
tx_pending_ = false; |
EnsureTransmission(); |
} |
@@ -104,7 +104,7 @@ void Uart::Task() { |
// Setup interrupt for next byte. |
HAL_StatusTypeDef status = HAL_UART_Receive_IT(uart_, &rx_data_, 1); |
if (status != HAL_OK) { |
- fletch::Print::Error("HAL_UART_Receive_IT returned %d\n", status); |
+ dartino::Print::Error("HAL_UART_Receive_IT returned %d\n", status); |
} |
} |
} |
@@ -118,7 +118,7 @@ void Uart::EnsureTransmission() { |
if (bytes > 0) { |
HAL_StatusTypeDef status = HAL_UART_Transmit_IT(uart_, tx_data_, bytes); |
if (status != HAL_OK) { |
- fletch::Print::Error("HAL_UART_Transmit_IT returned %d\n", status); |
+ dartino::Print::Error("HAL_UART_Transmit_IT returned %d\n", status); |
} |
tx_pending_ = true; |
} |