From aa422b5d781f1dce58488e15597b390c7218d034 Mon Sep 17 00:00:00 2001 From: Jake <jake.read@cba.mit.edu> Date: Mon, 17 Jun 2019 08:32:26 -0400 Subject: [PATCH] sort and notes for next moves --- README.md | 24 ++++++++++++++++++- bootloader/uf2-samdx1 | 1 + {platformio/ponyo => embedded}/.gitignore | 0 {platformio/ponyo => embedded}/.travis.yml | 0 {platformio/ponyo => embedded}/include/README | 0 {platformio/ponyo => embedded}/lib/README | 0 {platformio/ponyo => embedded}/platformio.ini | 0 .../src/hunks/comm/hunk_cobserial.cpp | 0 .../src/hunks/comm/hunk_cobserial.h | 0 .../src/hunks/hunk_adder.cpp | 0 .../ponyo => embedded}/src/hunks/hunk_adder.h | 0 .../src/hunks/hunk_link.cpp | 0 .../ponyo => embedded}/src/hunks/hunk_link.h | 0 .../src/hunks/hunk_reversal.cpp | 0 .../src/hunks/hunk_reversal.h | 0 .../src/hunks/hunk_ticker.cpp | 0 .../src/hunks/hunk_ticker.h | 0 .../ponyo => embedded}/src/hunks/hunks.h | 0 {platformio/ponyo => embedded}/src/main.cpp | 9 +++++++ .../src/states/state_byteArray.cpp | 0 .../src/states/state_byteArray.h | 0 .../ponyo => embedded}/src/states/states.cpp | 0 .../ponyo => embedded}/src/states/states.h | 0 .../src/transports/net_byteArray.cpp | 0 .../src/transports/net_byteArray.h | 0 .../src/transports/net_uint32.cpp | 3 ++- .../src/transports/net_uint32.h | 0 .../src/transports/nets.cpp | 0 .../ponyo => embedded}/src/transports/nets.h | 0 {platformio/ponyo => embedded}/src/trunk.cpp | 2 +- {platformio/ponyo => embedded}/src/trunk.h | 0 {platformio/ponyo => embedded}/test/README | 0 .../arduino}/sketch_apr01a/hunks.h | 0 .../arduino}/sketch_apr01a/input.h | 0 .../arduino}/sketch_apr01a/output.h | 0 .../arduino}/sketch_apr01a/serport.cpp | 0 .../arduino}/sketch_apr01a/serport.h | 0 .../arduino}/sketch_apr01a/sketch_apr01a.ino | 0 .../arduino}/sketch_apr01a/ticker.cpp | 0 .../arduino}/sketch_apr01a/ticker.h | 0 .../arduino}/sketch_apr01b/sketch_apr01b.ino | 0 .../dfcpp/dfcpp/dfcpp.cppproj | 0 {embedded => scratch}/dfcpp/dfcpp/main.cpp | 0 {ponyo => scratch/ponyo}/ponyo/TickerLED.cpp | 0 {ponyo => scratch/ponyo}/ponyo/TickerLED.h | 0 {ponyo => scratch/ponyo}/ponyo/hunks.cpp | 0 {ponyo => scratch/ponyo}/ponyo/hunks.h | 0 {ponyo => scratch/ponyo}/ponyo/main.cpp | 0 {ponyo => scratch/ponyo}/ponyo/ponyo.cppproj | 0 49 files changed, 36 insertions(+), 3 deletions(-) create mode 160000 bootloader/uf2-samdx1 rename {platformio/ponyo => embedded}/.gitignore (100%) rename {platformio/ponyo => embedded}/.travis.yml (100%) rename {platformio/ponyo => embedded}/include/README (100%) rename {platformio/ponyo => embedded}/lib/README (100%) rename {platformio/ponyo => embedded}/platformio.ini (100%) rename {platformio/ponyo => embedded}/src/hunks/comm/hunk_cobserial.cpp (100%) rename {platformio/ponyo => embedded}/src/hunks/comm/hunk_cobserial.h (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_adder.cpp (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_adder.h (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_link.cpp (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_link.h (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_reversal.cpp (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_reversal.h (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_ticker.cpp (100%) rename {platformio/ponyo => embedded}/src/hunks/hunk_ticker.h (100%) rename {platformio/ponyo => embedded}/src/hunks/hunks.h (100%) rename {platformio/ponyo => embedded}/src/main.cpp (95%) rename {platformio/ponyo => embedded}/src/states/state_byteArray.cpp (100%) rename {platformio/ponyo => embedded}/src/states/state_byteArray.h (100%) rename {platformio/ponyo => embedded}/src/states/states.cpp (100%) rename {platformio/ponyo => embedded}/src/states/states.h (100%) rename {platformio/ponyo => embedded}/src/transports/net_byteArray.cpp (100%) rename {platformio/ponyo => embedded}/src/transports/net_byteArray.h (100%) rename {platformio/ponyo => embedded}/src/transports/net_uint32.cpp (96%) rename {platformio/ponyo => embedded}/src/transports/net_uint32.h (100%) rename {platformio/ponyo => embedded}/src/transports/nets.cpp (100%) rename {platformio/ponyo => embedded}/src/transports/nets.h (100%) rename {platformio/ponyo => embedded}/src/trunk.cpp (98%) rename {platformio/ponyo => embedded}/src/trunk.h (100%) rename {platformio/ponyo => embedded}/test/README (100%) rename {arduino => scratch/arduino}/sketch_apr01a/hunks.h (100%) rename {arduino => scratch/arduino}/sketch_apr01a/input.h (100%) rename {arduino => scratch/arduino}/sketch_apr01a/output.h (100%) rename {arduino => scratch/arduino}/sketch_apr01a/serport.cpp (100%) rename {arduino => scratch/arduino}/sketch_apr01a/serport.h (100%) rename {arduino => scratch/arduino}/sketch_apr01a/sketch_apr01a.ino (100%) rename {arduino => scratch/arduino}/sketch_apr01a/ticker.cpp (100%) rename {arduino => scratch/arduino}/sketch_apr01a/ticker.h (100%) rename {arduino => scratch/arduino}/sketch_apr01b/sketch_apr01b.ino (100%) rename {embedded => scratch}/dfcpp/dfcpp/dfcpp.cppproj (100%) rename {embedded => scratch}/dfcpp/dfcpp/main.cpp (100%) rename {ponyo => scratch/ponyo}/ponyo/TickerLED.cpp (100%) rename {ponyo => scratch/ponyo}/ponyo/TickerLED.h (100%) rename {ponyo => scratch/ponyo}/ponyo/hunks.cpp (100%) rename {ponyo => scratch/ponyo}/ponyo/hunks.h (100%) rename {ponyo => scratch/ponyo}/ponyo/main.cpp (100%) rename {ponyo => scratch/ponyo}/ponyo/ponyo.cppproj (100%) diff --git a/README.md b/README.md index 2cea6d9..08f10ed 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,20 @@ Ponyo is a **[Distributed Dataflow Machine Control Context](https://gitlab.cba.m ### Current Status +[2019-06-16] + +After an arduous battle with JS, I'm (soon) making a return to CPP. In steps, this means: (1st) clarifying the link's role, and it's statemachine-ness. Dumps messages when nc, but tries to open up. Data ports, perhaps also, should dump messages if they're closed, and throw errors? Then (2nd) make sure that managers don't hold back anymore: they are stateless w/r/t connections. That's a hack that you can remove, nice, (3rd) is writing essentially the typeset.js equivalent for cpp, integrated with the link... I won't try to lay it all out here, that's what the work is. Fun fun. + +[2019-05-07] + +The Ponyo Return + +Primarily, with typeset.js, something similar. This is synchronous with writing nets, consider a link that uses those fn's ? Basically just need to key. And we don't have to do like, numchecks etc. Bytes are bytes, bless u cpp. + +Also, the manager-inside-of-itself, and the link -> that means adding dynamic hunk updates. + + - first thought is w/r/t the links ... a reasonable bootstrap is going to launch with a default link, cuttlefish will have to open that up and change it as it loads the recursive program ... or, a loaded program will have to update that link as it goes + [2019-04-16] ... @@ -466,7 +480,7 @@ However, is [sounds like this is tricky](https://isocpp.org/wiki/faq/pointers-to OK, you left this off here at hunk_link.cpp, // - write default onChange functio into states.cpp // - printing an error code back if it hasn't been redirected -// and then do this link work +// and then do this link work #### Links @@ -531,3 +545,11 @@ then, unknown steps Something that becomes obvious in CPP is that (besides its likelihood as a nice program-flow abstraction) the links can be identical on input and output sides - they really are just memory locations with state (full / not full). We can use the same class to pull and get from. Hunks can have respective handles on the same 'new'd thing ... the link. The net. Duplex nets! It's probably worth thinking carefully about how this might work. This is like end-to-end architecture for program assembly: as often as possible, the complexity is located in the hunks themselves... + +# The Ponyo Bootloader + +To speed this up, I'm leaning on Adafruit's bootloader. + +What makes me a little bit worried here is Adafruit's use of a few pins for QSPI memory, which they use to expose files-to-bootload. In retrospect, I maybe should have exposed these pins, as the adafruit bootloader probably tries to wake them up during startup. If I expose them to motor enable pins etc, I might have some trouble. + +In any case, to try it out, [here](https://github.com/adafruit/uf2-samdx1) is their bootloader code. The [releases](https://github.com/adafruit/uf2-samdx1/releases) page has a **.bin** of the built binary, I picked out the one for the feather_m4. I have an ATMEL-ICE, and I drew the board with SWD lines broken out, so I used Atmel Studio to flash that .bin, and lo-and-behold, it showed up. After debugging a tiny usb-connector-not-soldered-well issue, I can speak to my board. This is great news. diff --git a/bootloader/uf2-samdx1 b/bootloader/uf2-samdx1 new file mode 160000 index 0000000..c92c7d5 --- /dev/null +++ b/bootloader/uf2-samdx1 @@ -0,0 +1 @@ +Subproject commit c92c7d5987c3001c7d397ac2c61c61b62cb22bee diff --git a/platformio/ponyo/.gitignore b/embedded/.gitignore similarity index 100% rename from platformio/ponyo/.gitignore rename to embedded/.gitignore diff --git a/platformio/ponyo/.travis.yml b/embedded/.travis.yml similarity index 100% rename from platformio/ponyo/.travis.yml rename to embedded/.travis.yml diff --git a/platformio/ponyo/include/README b/embedded/include/README similarity index 100% rename from platformio/ponyo/include/README rename to embedded/include/README diff --git a/platformio/ponyo/lib/README b/embedded/lib/README similarity index 100% rename from platformio/ponyo/lib/README rename to embedded/lib/README diff --git a/platformio/ponyo/platformio.ini b/embedded/platformio.ini similarity index 100% rename from platformio/ponyo/platformio.ini rename to embedded/platformio.ini diff --git a/platformio/ponyo/src/hunks/comm/hunk_cobserial.cpp b/embedded/src/hunks/comm/hunk_cobserial.cpp similarity index 100% rename from platformio/ponyo/src/hunks/comm/hunk_cobserial.cpp rename to embedded/src/hunks/comm/hunk_cobserial.cpp diff --git a/platformio/ponyo/src/hunks/comm/hunk_cobserial.h b/embedded/src/hunks/comm/hunk_cobserial.h similarity index 100% rename from platformio/ponyo/src/hunks/comm/hunk_cobserial.h rename to embedded/src/hunks/comm/hunk_cobserial.h diff --git a/platformio/ponyo/src/hunks/hunk_adder.cpp b/embedded/src/hunks/hunk_adder.cpp similarity index 100% rename from platformio/ponyo/src/hunks/hunk_adder.cpp rename to embedded/src/hunks/hunk_adder.cpp diff --git a/platformio/ponyo/src/hunks/hunk_adder.h b/embedded/src/hunks/hunk_adder.h similarity index 100% rename from platformio/ponyo/src/hunks/hunk_adder.h rename to embedded/src/hunks/hunk_adder.h diff --git a/platformio/ponyo/src/hunks/hunk_link.cpp b/embedded/src/hunks/hunk_link.cpp similarity index 100% rename from platformio/ponyo/src/hunks/hunk_link.cpp rename to embedded/src/hunks/hunk_link.cpp diff --git a/platformio/ponyo/src/hunks/hunk_link.h b/embedded/src/hunks/hunk_link.h similarity index 100% rename from platformio/ponyo/src/hunks/hunk_link.h rename to embedded/src/hunks/hunk_link.h diff --git a/platformio/ponyo/src/hunks/hunk_reversal.cpp b/embedded/src/hunks/hunk_reversal.cpp similarity index 100% rename from platformio/ponyo/src/hunks/hunk_reversal.cpp rename to embedded/src/hunks/hunk_reversal.cpp diff --git a/platformio/ponyo/src/hunks/hunk_reversal.h b/embedded/src/hunks/hunk_reversal.h similarity index 100% rename from platformio/ponyo/src/hunks/hunk_reversal.h rename to embedded/src/hunks/hunk_reversal.h diff --git a/platformio/ponyo/src/hunks/hunk_ticker.cpp b/embedded/src/hunks/hunk_ticker.cpp similarity index 100% rename from platformio/ponyo/src/hunks/hunk_ticker.cpp rename to embedded/src/hunks/hunk_ticker.cpp diff --git a/platformio/ponyo/src/hunks/hunk_ticker.h b/embedded/src/hunks/hunk_ticker.h similarity index 100% rename from platformio/ponyo/src/hunks/hunk_ticker.h rename to embedded/src/hunks/hunk_ticker.h diff --git a/platformio/ponyo/src/hunks/hunks.h b/embedded/src/hunks/hunks.h similarity index 100% rename from platformio/ponyo/src/hunks/hunks.h rename to embedded/src/hunks/hunks.h diff --git a/platformio/ponyo/src/main.cpp b/embedded/src/main.cpp similarity index 95% rename from platformio/ponyo/src/main.cpp rename to embedded/src/main.cpp index d66376f..32fc607 100644 --- a/platformio/ponyo/src/main.cpp +++ b/embedded/src/main.cpp @@ -120,6 +120,7 @@ boolean addLink(String outId, String outputName, String inId, String inputName){ } // a prototype for this fn +// do it with indices boolean changeState(String hnkId, String stateName){ Hunk* hnk = nullptr; // find it by key @@ -153,6 +154,8 @@ void setup() { pinMode(13, OUTPUT); // hmmm Serial.begin(9600); + // probably the entry is here, I'll bet this is preventing + // the serial from enumerating while(!Serial); trunk->println("beginning pgms setup"); // setting up au-manuel for now @@ -172,6 +175,12 @@ void setup() { #define LOOP_DEBUG 1 void loop() { + /* -------------------------------- ---------------------------------- */ + /* ---------------------- recv manager messages ---------------------- */ + /* -------------------------------- ---------------------------------- */ + + // ? + /* -------------------------------- ---------------------------------- */ /* ------------------------ network transport ------------------------ */ /* -------------------------------- ---------------------------------- */ diff --git a/platformio/ponyo/src/states/state_byteArray.cpp b/embedded/src/states/state_byteArray.cpp similarity index 100% rename from platformio/ponyo/src/states/state_byteArray.cpp rename to embedded/src/states/state_byteArray.cpp diff --git a/platformio/ponyo/src/states/state_byteArray.h b/embedded/src/states/state_byteArray.h similarity index 100% rename from platformio/ponyo/src/states/state_byteArray.h rename to embedded/src/states/state_byteArray.h diff --git a/platformio/ponyo/src/states/states.cpp b/embedded/src/states/states.cpp similarity index 100% rename from platformio/ponyo/src/states/states.cpp rename to embedded/src/states/states.cpp diff --git a/platformio/ponyo/src/states/states.h b/embedded/src/states/states.h similarity index 100% rename from platformio/ponyo/src/states/states.h rename to embedded/src/states/states.h diff --git a/platformio/ponyo/src/transports/net_byteArray.cpp b/embedded/src/transports/net_byteArray.cpp similarity index 100% rename from platformio/ponyo/src/transports/net_byteArray.cpp rename to embedded/src/transports/net_byteArray.cpp diff --git a/platformio/ponyo/src/transports/net_byteArray.h b/embedded/src/transports/net_byteArray.h similarity index 100% rename from platformio/ponyo/src/transports/net_byteArray.h rename to embedded/src/transports/net_byteArray.h diff --git a/platformio/ponyo/src/transports/net_uint32.cpp b/embedded/src/transports/net_uint32.cpp similarity index 96% rename from platformio/ponyo/src/transports/net_uint32.cpp rename to embedded/src/transports/net_uint32.cpp index a6d8b8c..2e8b6c7 100644 --- a/platformio/ponyo/src/transports/net_uint32.cpp +++ b/embedded/src/transports/net_uint32.cpp @@ -3,7 +3,8 @@ // set class variables in the constructor? Inp_uint32::Inp_uint32(String nm){ name = nm; - type = "uint32_t"; + // renamed this ... + type = "uint32"; size = 4; dataPtr = malloc(size); } diff --git a/platformio/ponyo/src/transports/net_uint32.h b/embedded/src/transports/net_uint32.h similarity index 100% rename from platformio/ponyo/src/transports/net_uint32.h rename to embedded/src/transports/net_uint32.h diff --git a/platformio/ponyo/src/transports/nets.cpp b/embedded/src/transports/nets.cpp similarity index 100% rename from platformio/ponyo/src/transports/nets.cpp rename to embedded/src/transports/nets.cpp diff --git a/platformio/ponyo/src/transports/nets.h b/embedded/src/transports/nets.h similarity index 100% rename from platformio/ponyo/src/transports/nets.h rename to embedded/src/transports/nets.h diff --git a/platformio/ponyo/src/trunk.cpp b/embedded/src/trunk.cpp similarity index 98% rename from platformio/ponyo/src/trunk.cpp rename to embedded/src/trunk.cpp index 3aa5c71..443fd84 100644 --- a/platformio/ponyo/src/trunk.cpp +++ b/embedded/src/trunk.cpp @@ -60,7 +60,7 @@ boolean Trunk::writeCOBSerialPacket(uint8_t* buf, size_t len){ digitalWrite(13, HIGH); while(1); } - // cobs encode it + // cobs encode it size_t resl = StuffData(buf, len, cbuf_); // ship it; //Serial.write((uint8_t)resl); diff --git a/platformio/ponyo/src/trunk.h b/embedded/src/trunk.h similarity index 100% rename from platformio/ponyo/src/trunk.h rename to embedded/src/trunk.h diff --git a/platformio/ponyo/test/README b/embedded/test/README similarity index 100% rename from platformio/ponyo/test/README rename to embedded/test/README diff --git a/arduino/sketch_apr01a/hunks.h b/scratch/arduino/sketch_apr01a/hunks.h similarity index 100% rename from arduino/sketch_apr01a/hunks.h rename to scratch/arduino/sketch_apr01a/hunks.h diff --git a/arduino/sketch_apr01a/input.h b/scratch/arduino/sketch_apr01a/input.h similarity index 100% rename from arduino/sketch_apr01a/input.h rename to scratch/arduino/sketch_apr01a/input.h diff --git a/arduino/sketch_apr01a/output.h b/scratch/arduino/sketch_apr01a/output.h similarity index 100% rename from arduino/sketch_apr01a/output.h rename to scratch/arduino/sketch_apr01a/output.h diff --git a/arduino/sketch_apr01a/serport.cpp b/scratch/arduino/sketch_apr01a/serport.cpp similarity index 100% rename from arduino/sketch_apr01a/serport.cpp rename to scratch/arduino/sketch_apr01a/serport.cpp diff --git a/arduino/sketch_apr01a/serport.h b/scratch/arduino/sketch_apr01a/serport.h similarity index 100% rename from arduino/sketch_apr01a/serport.h rename to scratch/arduino/sketch_apr01a/serport.h diff --git a/arduino/sketch_apr01a/sketch_apr01a.ino b/scratch/arduino/sketch_apr01a/sketch_apr01a.ino similarity index 100% rename from arduino/sketch_apr01a/sketch_apr01a.ino rename to scratch/arduino/sketch_apr01a/sketch_apr01a.ino diff --git a/arduino/sketch_apr01a/ticker.cpp b/scratch/arduino/sketch_apr01a/ticker.cpp similarity index 100% rename from arduino/sketch_apr01a/ticker.cpp rename to scratch/arduino/sketch_apr01a/ticker.cpp diff --git a/arduino/sketch_apr01a/ticker.h b/scratch/arduino/sketch_apr01a/ticker.h similarity index 100% rename from arduino/sketch_apr01a/ticker.h rename to scratch/arduino/sketch_apr01a/ticker.h diff --git a/arduino/sketch_apr01b/sketch_apr01b.ino b/scratch/arduino/sketch_apr01b/sketch_apr01b.ino similarity index 100% rename from arduino/sketch_apr01b/sketch_apr01b.ino rename to scratch/arduino/sketch_apr01b/sketch_apr01b.ino diff --git a/embedded/dfcpp/dfcpp/dfcpp.cppproj b/scratch/dfcpp/dfcpp/dfcpp.cppproj similarity index 100% rename from embedded/dfcpp/dfcpp/dfcpp.cppproj rename to scratch/dfcpp/dfcpp/dfcpp.cppproj diff --git a/embedded/dfcpp/dfcpp/main.cpp b/scratch/dfcpp/dfcpp/main.cpp similarity index 100% rename from embedded/dfcpp/dfcpp/main.cpp rename to scratch/dfcpp/dfcpp/main.cpp diff --git a/ponyo/ponyo/TickerLED.cpp b/scratch/ponyo/ponyo/TickerLED.cpp similarity index 100% rename from ponyo/ponyo/TickerLED.cpp rename to scratch/ponyo/ponyo/TickerLED.cpp diff --git a/ponyo/ponyo/TickerLED.h b/scratch/ponyo/ponyo/TickerLED.h similarity index 100% rename from ponyo/ponyo/TickerLED.h rename to scratch/ponyo/ponyo/TickerLED.h diff --git a/ponyo/ponyo/hunks.cpp b/scratch/ponyo/ponyo/hunks.cpp similarity index 100% rename from ponyo/ponyo/hunks.cpp rename to scratch/ponyo/ponyo/hunks.cpp diff --git a/ponyo/ponyo/hunks.h b/scratch/ponyo/ponyo/hunks.h similarity index 100% rename from ponyo/ponyo/hunks.h rename to scratch/ponyo/ponyo/hunks.h diff --git a/ponyo/ponyo/main.cpp b/scratch/ponyo/ponyo/main.cpp similarity index 100% rename from ponyo/ponyo/main.cpp rename to scratch/ponyo/ponyo/main.cpp diff --git a/ponyo/ponyo/ponyo.cppproj b/scratch/ponyo/ponyo/ponyo.cppproj similarity index 100% rename from ponyo/ponyo/ponyo.cppproj rename to scratch/ponyo/ponyo/ponyo.cppproj -- GitLab