22
33[ ![ AUnit Tests] ( https://github.com/bxparks/EpoxyDuino/actions/workflows/aunit_tests.yml/badge.svg )] ( https://github.com/bxparks/EpoxyDuino/actions/workflows/aunit_tests.yml )
44
5- ** New** : [ GitHub Discussions] ( https://github.com/bxparks/EpoxyDuino/discussions )
6- for this project is now active! Let's use that for general support questions,
7- and reserve the [ GitHub Issues] ( https://github.com/bxparks/EpoxyDuino/issues )
8- section for bugs and feature requests.
9-
105This project contains a small (but often effective) implementation of the
116Arduino programming framework for Linux, MacOS, FreeBSD (experimental) and
127potentially other POSIX-like systems. Originally, it was created to allow
@@ -60,16 +55,10 @@ The disadvantages are:
6055 environments (e.g. 16-bit ` int ` versus 32-bit ` int ` , or 32-bit ` long ` versus
6156 64-bit ` long ` ).
6257
63- ** Version** : 0.8 (2021-08-08 )
58+ ** Version** : 1.0 (2021-09-30 )
6459
6560** Changelog** : See [ CHANGELOG.md] ( CHANGELOG.md )
6661
67- ** Breaking Change** : Prior to v0.5, this project was known as "UnixHostDuino".
68- The old ` UNIX_HOST_DUINO ` macro and ` UnixHostDuino.mk ` include file still exist
69- for backwards compatibility. See
70- [ Issue #15 ] ( https://github.com/bxparks/EpoxyDuino/issues/15 )
71- for more details.
72-
7362## Table of Contents
7463
7564* [ Installation] ( #Installation )
@@ -87,6 +76,7 @@ for more details.
8776 * [ Additional Clean Up] ( #AdditionalCleanUp )
8877 * [ Alternate Arduino Core] ( #AlternateArduinoCore )
8978 * [ PlatformIO] ( #PlatformIO )
79+ * [ Command Line Flags and Arguments] ( #CommandLineFlagsAndArguments )
9080* [ Supported Arduino Features] ( #SupportedArduinoFeatures )
9181 * [ Arduino Functions] ( #ArduinoFunctions )
9282 * [ Serial Port Emulation] ( #SerialPortEmulation )
@@ -320,9 +310,9 @@ FooLibrary
320310|-- library.properties
321311|-- src
322312| |-- FooLibrary.h
323- | | -- foolib
324- | | |-- file.h
325- | | `-- file.cpp
313+ | ` -- foolib
314+ | |-- file.h
315+ | `-- file.cpp
326316`-- tests
327317 |-- AxxTest
328318 | |-- AxxTest.ino
@@ -513,8 +503,12 @@ Core. EpoxyDuino provides the ability substitute a different Arduino API Core
513503through 2 Makefile variables:
514504
515505* ` EPOXY_CORE `
516- * This Makefile variable defines the C-preprocessor macro which will be
517- defined through the ` -D ` flag through ` -D $(EPOXY_CORE) ` .
506+ * ` EPOXY_CORE_PATH `
507+
508+ #### ` EPOXY_CORE `
509+
510+ The ` EPOXY_CORE ` Makefile variable defines the C-preprocessor macro which will
511+ be defined through the ` -D ` flag through ` -D $(EPOXY_CORE) ` .
518512
519513There are currently 2 valid options for this Makefile variable:
520514
@@ -538,12 +532,12 @@ compiler, which will activate any code that is guarded by:
538532#endif
539533```
540534
535+ #### ` EPOXY_CORE_PATH `
536+
541537If the ` EPOXY_CORE ` make variable is insufficient (e.g. because the appropriate
542538changes have not been incorporated into ` $(EPOXY_DUINO_DIR)/cores/epoxy/ ` ), then
543- there is an even bigger hammer with the following make variable:
544-
545- * ` EPOXY_CORE_PATH `
546- * Defines the full-path to the Arduino Core API files.
539+ the ` EPOXY_CORE_PATH ` provides an even bigger hammer. It defines the the
540+ full-path to the Arduino Core API files.
547541
548542By default, this is set to ` $(EPOXY_DUINO_DIR)/cores/epoxy ` . You can create your
549543own set of Arduino API files in a directory of your choosing, and set this
@@ -562,6 +556,50 @@ in [Issue #31](https://github.com/bxparks/EpoxyDuino/pull/31) (thanks
562556https://github.com/lopsided98 ). However, this functionality is * unsupported* . If
563557it becomes broken in the future, please send me a PR to fix it.
564558
559+ <a name =" CommandLineFlagsAndArguments " ></a >
560+ ### Command Line Flags and Arguments
561+
562+ The standard Arduino environment does not provide command line arguments, since
563+ a microcontroller does not normally provide a command line environment.
564+ When an Arduino application is compiled Using EpoxyDuino, the Unix command line
565+ parameters (` argc ` and ` argv ` ) become available through 2 global variables:
566+
567+ * ` extern int epoxy_argc `
568+ * ` extern const char* const* epoxy_argv `
569+
570+ The [ examples/CommandLine] ( examples/CommandLine ) program contains a basic
571+ command line parser which can be copied and customized for different
572+ applications:
573+
574+ ```
575+ $ ./CommandLine.out --help
576+ Usage: ./CommandLine.out [--help|-h] [-s] [--include word] [--] [words ...]
577+
578+ $ ./CommandLine.out one two
579+ arg: one
580+ arg: two
581+
582+ $ ./CommandLine.out -s
583+ flag: -s
584+
585+ $ ./CommandLine.out --include inc one two
586+ flag: --include inc
587+ arg: one
588+ arg: two
589+
590+ $ ./CommandLine.out --include inc -- -one two
591+ flag: --include inc
592+ arg: -one
593+ arg: two
594+
595+ $ ./CommandLine.out -a
596+ Unknonwn flag '-a'
597+ Usage: ./CommandLine.out [--help|-h] [-s] [--include word] [--] [words ...]
598+ ```
599+
600+ A more advanced example can be seen in
601+ [ AUnit/TestRunner.cpp] ( https://github.com/bxparks/AUnit/blob/develop/src/aunit/TestRunner.cpp ) .
602+
565603<a name =" SupportedArduinoFeatures " ></a >
566604## Supported Arduino Features
567605
@@ -595,7 +633,7 @@ The following functions and features of the Arduino framework are implemented:
595633 * ` pgm_read_byte() ` , ` pgm_read_word() ` , ` pgm_read_dword() ` ,
596634 ` pgm_read_float() ` , ` pgm_read_ptr() `
597635 * ` strlen_P() ` , ` strcat_P() ` , ` strcpy_P() ` , ` strncpy_P() ` , ` strcmp_P() ` ,
598- ` strncmp_P() ` , ` strcasecmp_P() ` , ` strchr_P() ` , ` strrchr_P() `
636+ ` strncmp_P() ` , ` strcasecmp_P() ` , ` strchr_P() ` , ` strrchr_P() ` , ` strstr_P() `
599637 * ` memcpy_P() ` , ` vsnprintf_P() `
600638 * ` PROGMEM ` , ` PGM_P ` , ` PGM_VOID_P ` , ` PSTR() `
601639* ` IPAddress.h `
@@ -606,7 +644,8 @@ The following functions and features of the Arduino framework are implemented:
606644* ` Wire.h ` (stub implementation)
607645* ` SPI.h ` (stub implementation)
608646
609- See [ Arduino.h] ( https://github.com/bxparks/EpoxyDuino/blob/develop/Arduino.h )
647+ See
648+ [ Arduino.h] ( https://github.com/bxparks/EpoxyDuino/blob/develop/cores/epoxy/Arduino.h )
610649for the latest list. Most of the header files included by this ` Arduino.h `
611650file were copied and modified from the [ arduino: avr
612651core] ( https://github.com/arduino/ArduinoCore-avr/tree/master/cores/arduino ) ,
@@ -809,19 +848,7 @@ This library has been tested on:
809848<a name =" Bugs " ></a >
810849## Bugs and Limitations
811850
812- If the executable (e.g. ` SampleTest.out ` ) is piped to the ` less(1) ` or ` more(1) `
813- command, sometimes (not all the time) the executable hangs and displays nothing
814- on the pager program. I don't know why, it probably has to do with the way that
815- the ` less ` or ` more ` programs manipulate the ` stdin ` . The solution is to
816- explicitly redirect the ` stdin ` :
817-
818- ```
819- $ ./SampleTest.out | grep failed # works
820-
821- $ ./SampleTest.out | less # hangs
822-
823- $ ./SampleTest.out < /dev/null | less # works
824- ```
851+ None that I am aware of.
825852
826853<a name =" FeedbackAndSupport " ></a >
827854## Feedback and Support
0 commit comments