Giter Club home page Giter Club logo

arduino's People

Contributors

baorepo avatar thingsturn avatar wdyichen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arduino's Issues

Uncompilable code in power_output_startup()

You write

#ifdef WIO_W600
void power_output_startup()
{
pinMode(PB_7, OUTPUT);
digitalWrite(PB_7, HIGH);
}
#endif

With the only includes being

#include <stdio.h>
#include "debug.h"

and

https://github.com/w600/arduino/blob/master/cores/w600/debug.h

Yet the function attempts to call into digitalWrite() and and pinMode() which is undeclared.

GCC throws the errors

C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp: In function 'void power_output_startup()':
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:23:13: error: 'PB_7' was not declared in this scope
     pinMode(PB_7, OUTPUT);
             ^
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:23:19: error: 'OUTPUT' was not declared in this scope
     pinMode(PB_7, OUTPUT);
                   ^
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:23:25: error: 'pinMode' was not declared in this scope
     pinMode(PB_7, OUTPUT);
                         ^
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:24:24: error: 'HIGH' was not declared in this scope
     digitalWrite(PB_7, HIGH);
                        ^
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:24:28: error: 'digitalWrite' was not declared in this scope
     digitalWrite(PB_7, HIGH);
                            ^

thus the core in its current latest-git form is uncompilable.

Adding #include <Arduino.h> also does not make the code compile because of code in WString.h

Compiling .pio\build\wio_w600\FrameworkArduino\core_w600_main.cpp.o
In file included from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/Print.h:18:0,
                 from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/Stream.h:15,
                 from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/HardwareSerial.h:15,
                 from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/wiring.h:24,
                 from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/Arduino.h:13,
                 from C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600\core_w600_main.cpp:21:
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/WString.h:137:83: error: conflicting declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, const char*)'
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
                                                                                   ^
C:\Users\Maxi\.platformio\packages\framework-arduino-w60x\cores\w600/WString.h:136:27: note: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)'
  friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
                           ^
[...] many more errors

micros() code bug

You write

uint32_t micros(void)
{
/* Ensure COUNTFLAG is reset by reading SysTick control and status register */
LL_SYSTICK_IsActiveCounterFlag();
uint32_t m = tls_os_get_time();
uint32_t u = SysTick->LOAD - SysTick->VAL;
if(LL_SYSTICK_IsActiveCounterFlag) {
m = tls_os_get_time();
u = SysTick->LOAD - SysTick->VAL;
}
return (uint32_t)( m * 2000 + (u * 2000) / SysTick->LOAD);
}

and you write

static inline uint32_t LL_SYSTICK_IsActiveCounterFlag(void)
{
return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk));
}

By which you can see that in line 45, you are not calling the function and checking its return value, you are doing if(function name), and since function name is also the address of the function, the if statement will always have a true statement.

Multiple functions with no return value although declared in prototype

GCC is throwing errors in your code regarding warning: no return statement in function returning non-void errors.

E.g., where is the return statement in this function that's supposed return a signed short?

extern "C" signed short uart_rx_cb(uint16_t uart_no, unsigned short len,
unsigned char * pbuf, int *pend)
{
int ret = 0;
int _len = 0;
do
{
ret = tls_uart_read(uart_no, pbuf + *pend, 1);
if (ret > 0)
(*pend) = *pend + ret;
_len += ret;
} while (ret != 0);
}

Same here

int init_uart1_cfg(int uart_no, bool uart1_mul)
{
unsigned int reg = 0;
if (TLS_UART_1 == uart_no
&& true == uart1_mul
&& ~(INIT_UART1_MUL & init_uart1_pin_cfg))
{
delay(10); // SHOULD delay 0.010 second.
reg = tls_reg_read32(HR_GPIOB_AFSEL);
reg &= ~(BIT(11) | BIT(12));
tls_reg_write32(HR_GPIOB_AFSEL, reg);
wm_uart1_rx_config(TLS_UART1_MUL_RX);
wm_uart1_tx_config(TLS_UART1_MUL_TX);
} else if (TLS_UART_1 == uart_no
&& false == uart1_mul
&& ~(INIT_UART1_DEF & init_uart1_pin_cfg))
{
delay(10); // SHOULD delay 0.010 second.
reg = tls_reg_read32(HR_GPIOB_AFSEL);
reg &= ~(BIT(17) | BIT(18));
tls_reg_write32(HR_GPIOB_AFSEL, reg);
wm_uart1_rx_config(WM_IO_PB_11);
wm_uart1_tx_config(WM_IO_PB_12);
init_uart1_pin_cfg = INIT_UART1_DEF;
}
}

Linux support

Currently cannot be installed in Arduino IDE on Linux..
Are there any plans to support it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.