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

Added IPAddress.h SPI.h , WCharacter.h, sqrt and delayMicroseconds #18

Merged
merged 7 commits into from
Feb 16, 2021

Conversation

ramboerik
Copy link
Contributor

Hi,

I'm using your linux port as a drop in replacement of the official Arduino core when compiling unit tests. I ran across some missing functions and added those that gave me compiler errors. Most is just copy and paste from the official core!

Copy link
Owner

@bxparks bxparks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks, this is great. I like how you fixed some style issues for consistency, e.g. trailing white spaces and changing boolean to bool.

A few requests before I merge this:

  1. Can you rebase your PR onto the latest commit on the develop branch? There should be no conflicts with anything that I committed since you branched.
  2. Can you update the copyright note at the top to add your name, and a few lines to note that you changed a few things?
  3. An incorrect function signature on delayMicroseconds(), I'll point that out in the review.

Arduino.cpp Outdated
@@ -21,6 +21,10 @@
// Arduino methods emulated in Unix
// -----------------------------------------------------------------------

void delayMicroseconds(unsigned long us) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

void delayMicroSeconds(unsigned int us)

to be compatible with other cores.

Arduino.h Outdated
@@ -81,6 +82,7 @@

extern "C" {

void delayMicroseconds(unsigned long us);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, change unsigned long to unsigned int

/*
IPAddress.cpp - Base class that provides IPAddress
Copyright (c) 2011 Adrian McEwen. All right reserved.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something like:

Copied from Arduino AVR core 1.8.3 by Erik Tideman. Removed
unnecessary 'friend' declarations.

* Copyright (c) 2014 by Paul Stoffregen <paul@pjrc.com> (Transaction API)
* Copyright (c) 2014 by Matthijs Kooijman <matthijs@stdin.nl> (SPISettings AVR)
* Copyright (c) 2014 by Andrew J. Kroll <xxxajk@gmail.com> (atomicity fixes)
* SPI Master library for arduino.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something like:

Copyright (c) 2021 by Erik Tideman (Replaced actual implementations with stubs.)

* Copyright (c) 2014 by Paul Stoffregen <paul@pjrc.com> (Transaction API)
* Copyright (c) 2014 by Matthijs Kooijman <matthijs@stdin.nl> (SPISettings AVR)
* Copyright (c) 2014 by Andrew J. Kroll <xxxajk@gmail.com> (atomicity fixes)
* SPI Master library for arduino.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something like:

Copyright (c) 2021 by Erik Tideman (Replaced actual implementations with stubs.)

/*
WCharacter.h - Character utility functions for Wiring & Arduino
Copyright (c) 2010 Hernando Barragan. All right reserved.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something like:

Copyright (c) 2021 by Erik Tideman (Replaced 'boolean' with 'bool')

@ramboerik
Copy link
Contributor Author

Hi again,
all comments should be resolved now,

Thanks for great work!

@bxparks
Copy link
Owner

bxparks commented Feb 16, 2021

This looks great, thanks for sending the PR.
There is one little compiler warning in SPI.h. You forgot to add a 'return 0' from uint8_t transfer(uint8_t data). I'll fix that after I merge this in.

@bxparks bxparks merged commit 08dfd5b into bxparks:develop Feb 16, 2021
bxparks added a commit that referenced this pull request Feb 16, 2021
@bxparks bxparks mentioned this pull request Feb 20, 2021
bxparks added a commit that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants