Coder Social home page Coder Social logo

aardvark-'s People

Contributors

shakna-israel avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

aardvark-'s Issues

Flash

Assembling the avrdude pipeline

Build flag

Any intermediary files are built to a temporary directory, and cleaned up if there are no errors.

Otherwise the user can clean the temporary directory themselves, and the temporary directory should get reported at the start of a build procedure.

Example:

> aardvark build 'Arduino Pro Mini' ttyUSB main.c

Building to /var/folders/d9/t77j046j6_s6wkm5d3x_pll80000gn/T/tmp.wN7e9UWz
Finished successfully.

getmodeldata doesn't work

getmodeldata doesn't work as expected...

> getmodeldata 'Arduino Pro Mini'
 115200 atmega328p 32256 2048
 19200 atmega168 30720 2048
 19200 atmega168 30720 2048
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 2048
 19200 atmega168 30720 2048
 19200 atmega168 30720 2048
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 2048
 19200 atmega168 14336 1024
 115200 atmega1280 126976
 115200 atmega2560 253952
 115200 atmega1280 126976
 115200 atmega2560 253952 8192
 57600 atmega32u4 28672 2560
 57600 atmega32u4 28672 2560
 57600 atmega32u4 28672 2560
 57600 atmega32u4 28672 2560
 115200 atmega328p 28672 2048
 115200 atmega328p 28672 2048
 19200 atmega168 14336 1024
 115200 atmega328p 32256 2048
 57600 atmega328p 30720 2048
 19200 atmega328p 28672 2048
 19200 atmega328p 28672 2048
 19200 atmega168 14336 1024
 57600 atmega32u4 28672 2560
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 2048
 19200 atmega168 14336 1024
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 2048
 57600 atmega328p 30720 204
 57600 atmega328p 30720 204
 57600 atmega328p 30720 204
 19200 atmega168 14336 1024
 19200 atmega168 14336 1024
 19200 atmega168 14336 1024
 19200 atmega168 14336 1024
 115200 atmega168 14336 1024
 115200 atmega168 14336 1024
 115200 atmega8 7168 1024
 57600 atmega32u4 28672 2560

Kinda shocked that compiling works if this is the case.

Check data size

avr-size can, given an ELF file, tell us how big our program is, and how much RAM it takes up.

Compile

Assemble the avr-gcc pipeline

Completions

Tab completions for bash, zsh and fish would probably be helpful.

Dependency management

Should we attempt to drag down dependencies, with user permission? Or is that beyond scope?

Check port

We need to try and confirm the port exists, but maybe also if it can be written to, or read from.

Licensing

A brand-name Arduino has some licensing restrictions. May need to replace Arduino-references with better wording about clone compatibility.

Simplify C

Witthout Arduino IDE we're left with a more complex C syntax.

Compare:

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000); 
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000); 
}

Against the C version:

#include <avr/io.h>
#include <util/delay.h>
 
int main (void)
{
 DDRB |= _BV(DDB5);
 
 while(1) {
  PORTB |= _BV(PORTB5);
  _delay_ms(1000);
 
  PORTB &= ~_BV(PORTB5);
  _delay_ms(1000);
 }
}

It'd be nice to write some wrappers around the common operations.

Smells, maybe bugs

Shellcheck noticed some smells, maybe a small bug

> shellcheck aardvark

In aardvark line 5:
VER='0.0'
^-- SC2034: VER appears unused. Verify it or export it.


In aardvark line 14:
if [ "$(uname)" == "Darwin" ]; then
                ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 31:
root=$(dirname $($rlink -f $0))
               ^-- SC2046: Quote this to prevent word splitting.
                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In aardvark line 33:
wd=$(pwd)
^-- SC2034: wd appears unused. Verify it or export it.


In aardvark line 35:
. "$root/.help"
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.


In aardvark line 37:
if [ -z "$1" ] || [ "$1" == '--help' ] || [ "$1" == '-h' ]; then
                         ^-- SC2039: In POSIX sh, == in place of = is undefined.
                                                 ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 42:
. "$root/.model-tools"
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.


In aardvark line 44:
if [ "$1" == 'list' ]; then
          ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 49:
. "$root/.tools"
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.


In aardvark line 50:
. "$root/.main"
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.


In aardvark line 52:
if [ "$1" == 'build' ]; then
          ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 57:
if [ "$1" == 'compile' ]; then
          ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 62:
if [ "$1" == 'flash' ]; then
          ^-- SC2039: In POSIX sh, == in place of = is undefined.


In aardvark line 68:
echo 'Try `aardvark --help`' >&2
     ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

It couldn't review our imports by itself, so...


File: .help

> shellcheck -s sh .help

No issues there.


File: main

> shellcheck -s sh .main

In .main line 13:
    echo 'Confirm it can be found in `aardvark list`' >&2
         ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.


In .main line 52:
  maxsize=$(getmaxsize "$1")
  ^-- SC2034: maxsize appears unused. Verify it or export it.


In .main line 55:
  datasize=$(getmaxdatasize "$1")
  ^-- SC2034: datasize appears unused. Verify it or export it.


In .main line 74:
  echo $(ls -lah "$3".ihex)
       ^-- SC2046: Quote this to prevent word splitting.
       ^-- SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.


In .main line 88:
    echo 'Confirm it can be found in `aardvark list`' >&2
         ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.


In .main line 96:
  if [ -z /dev/"$2" ]; then
          ^-- SC2157: Argument to -z is always false due to literal strings.

Some false positives, one or two subtle bugs.


File: .model-tools

> shellcheck -s sh .model-tools

In .model-tools line 2:
  cat "$root/.models" | awk -F '|' '{print $1}'
      ^-- SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
       ^-- SC2154: root is referenced but not assigned.

SC2154 isn't relevant, as root is assigned in a different file, earlier.

SC2002 is basically an optimisation.


File: .tools

> shellcheck -s sh .tools

Nothing here.

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.