Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: platforms/stm/disco_dartino/src/uart.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platforms/stm/disco_dartino/src/uart.h ('k') | platforms/stm/disco_dartino/template/startup_stm32f746xx.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « platforms/stm/disco_dartino/src/uart.h ('k') | platforms/stm/disco_dartino/template/startup_stm32f746xx.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698