Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New way to test with the usart, vscode/intellisense added, all code in a namespace and some code cleanup #15

Merged
merged 35 commits into from May 14, 2019

Conversation

Projects
None yet
4 participants
@itzandroidtab
Copy link
Contributor

commented May 3, 2019

PatrickDekker98 and others added some commits Apr 29, 2019

Merge pull request #12 from R2D2-2019/feature-test_usart
Feature test usart into release
Merge pull request #14 from R2D2-2019/feature-error_when_usart0
Made the constructor smaller and moved if's to a array
Merge pull request #13 from R2D2-2019/feature-own_namespace
Moved all usart to their own namespace, code formatting and vscode tasks/intellisense added

itzandroidtab added some commits May 3, 2019

@itzandroidtab itzandroidtab reopened this May 4, 2019

@itzandroidtab

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2019

reopened this because the bugfix is merged

Show resolved Hide resolved code/headers/hardware_usart.hpp Outdated
Show resolved Hide resolved code/headers/hardware_usart.hpp Outdated
@@ -41,7 +45,7 @@ namespace r2d2 {
/// used for char arrays to quickly send more than one byte
/// In practice useing this fuction is more stable than repeated use of
/// send_byte() Especially when the values are repeated.
hardware_usart_c &operator<<(const char *c) ;
hardware_usart_c &operator<<(const char *c);

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 8, 2019

Could a overload for ostream be used here? That way, the conversion operations it provides would be available

Show resolved Hide resolved code/headers/test_usart.hpp Outdated
Show resolved Hide resolved code/src/hardware_usart.cpp Outdated

PatrickDekker98 added some commits May 8, 2019

changes requested in pr#15 were added test_usart and hardware_usart a…
…re now templated, usart_ports_c is now usart_ports
now travis will pass, apearantly templates don't play nice with defin…
…itions in a cpp file so all is defined and declared in the hpp file

@PatrickDekker98 PatrickDekker98 requested a review from LRstudentHU May 9, 2019

@@ -1,77 +1,192 @@
#pragma once

#ifndef _HARDWARE_USART_CPP

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

We have #pragma once

Usart *usart;
uint32_t rx_mask;
uint32_t tx_mask;
Pio * pio;

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Remove space right of *

{USART3, PIO_PD5B_RXD3, PIO_PD4B_TXD3, PIOD, peripheral::peripheral_b, ID_USART3}
};

void set_peripheral(Pio * pio, uint32_t mask, peripheral p) {

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Remove space right of *


class hardware_usart_c : public usart_connection_c{
template <size_t buffer_length = 250>

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Template parameters are CamelCase, so BufferLength


/// @brief receive a byte by reading the US_RHR register
/// @return byte received
uint8_t receive_byte();
uint8_t receive_byte(){

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Space after ()


public:
hardware_usart_c(unsigned int baudrate, uart_ports_c usart_port) ;
hardware_usart_c(unsigned int baudrate, usart_ports usart_port)

This comment has been minimized.

Copy link
@LRstudentHU
Show resolved Hide resolved code/headers/hardware_usart.hpp

/// @brief receive char via usart
/// @return char received
char getc() override;
char getc() override {
if (available() > 0) {

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Suggested change
if (available() > 0) {
if (char_available()) {

template <size_t buffer_length = 250>

This comment has been minimized.

Copy link
@LRstudentHU

LRstudentHU May 9, 2019

Template parameters are CamelCase, so BufferLength

@PatrickDekker98 PatrickDekker98 referenced this pull request May 13, 2019

Merged

Patch changes pr#15 #19

PatrickDekker98 added some commits May 13, 2019

@PatrickDekker98 PatrickDekker98 requested a review from LRstudentHU May 13, 2019

@florianhumblot florianhumblot self-requested a review May 14, 2019

Show resolved Hide resolved code/headers/hardware_usart.hpp
Show resolved Hide resolved code/headers/hardware_usart.hpp
Show resolved Hide resolved code/headers/hardware_usart.hpp Outdated

@PatrickDekker98 PatrickDekker98 merged commit e8d944a into master May 14, 2019

4 checks passed

Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.