ESP8266 NONOS SDK – Read SpiFlash size of nested data during runtime

So today I ran into a little bit of a snag, I was trying to copy an unknown amount of data into a buffer and then strcat That into another buffer. However during this I had a slight issue where the unknown data coming in the first buffer even though it fits into the destination buffer once it gets strcat into the 2nd buffer it may not. So I had identify the size of the unknown data, the issue was that I was pulling this data during runtime via SPIflash so I crafted this nice little function below to give me an idea of the size of the data that is in the 2nd buffer then in my main function count down the remaining bytes as I take the data in to the first unknown buffer, then chopping off the rest to prevent the chip from crashing in a buffer overflow.

Powering the ESP8266 with a LM3671

So after hunting around for a little bit, I stumbled upon these as a solution.

http://www.ti.com/lit/ds/symlink/lm3671.pdf

The device seemed very efficient and a perfect solution for a 3.7V Lipo to Power a 3.3V ESP and DHT11/22 Thermostat. One thing to note is this also has an EN pin, I may need to jump it to the VIN to ensure this is alway’s enabled on for my device. Seem that after taking a look at the Typical Application sch that implementing one of these on a Prototype board won’t be too bad. I’ll need to hook it up to my home power supply to test the voltage drop and see if It can hang in at 3.3volts even while the Lipo is on its last legs at the end of the battery drain.

So Lucky for me Adafruit has a small little PCB with this installed on it with a few header pins. One of the gotchas though is that for this project and as normal we need to make a Ground rail so that everything can connect to common. Now one thing to take from this is that the breakout board seems to have a Surface Mount Device/Technology resistor attached to the feedback line. This resister is E24 marked resistor. To calculate the value take the first two digits and then add the third digit amount of zeros. In this case 104 turn’s into “10” + “0000” = 100,000 or it’s a 100kohm resistor.

Arabesque Op.100 No.2

So recently I just finished Arabesque Opus. 100 No. 2 by Burgmuller. The song looked difficult at first but turned out to be actually pretty easy. First: By taking a look at the last chord we can easily identify that the song is written in A Minor. Second: The speed is fast pace using a 2/4 key signature.

The song starts with A minor triad on the left hand to start the beat of the tempo. This is something to note as sometimes you can go to fast on your left and your right has to go twice as fast to keep up, So it’s best to take this beat as slow as possible without messing up your timing. Next, it goes from A Minor to D/F then back to A. A Melody is built then it ends on a ‘E’ sforzando! Nice and loud.

The phrase repeats then goes into a fast pace left hand progression just like the right. Then is almost mirrored at the starts with an A to a D/F back to an A.

One big thing to note are the repeat bars to ensure you revert back to the correct bar to continue playing again.

and lastly ending on SF Fermata of A. Fermata has a long emphasis, so be aware.

A great list of symbol definition can be found here. https://melodyful.com/complete-list-of-music-symbols-with-their-meaning

Evolving Train of Thought for C/C++ Library's and Header Files

So, In the last few weeks’s I have been converting my Large ESP8266 project to multiple .h Module files so I can carry functions over from project to project and at the same time have them centrally managed to update code / fix bugs so they carry over to all of my projects.

One important detail on how I do this is to be able to trigger function code from within the Main project as needed so I don’t have to handle user specific events within the Header file where it does not belong. So, I do this by using TypeDef and declaring a Prototype for my Callback function. In this case,

Then set the callback function,

Set the callback in the Header file

Then in my Header file I then check to see if the value is set != NULL. If so then I call it.

The Main Function will get triggered and I can then access the variables stored in the STACK/HEAP depending on how I pass it to the caller from the callee.

One thing to note for the LOVE OF ORANGE JUICE WATCH OUT FOR USE AFTER FREE ISSUES. If your doing this from an ASync call just be aware to Lock the thread/variables so you don’t crash or use Data that get’s falsely injected!

With this method you can just Include the Handler, Call the Coordinating Init Function and pass the &Address of a function matching the prototype and your off to the races!

Full Header and Main.C example
DHT.H
#ifndef dhtthermastat
#define dhtthermastat

Main.C

Appellee's Opening Brief – Response from District Attorney's office

OooOoOo, Look what I received yesterday. So, I really can take this two different ways.
1: The D.A. agrees with my stance that the court error’d in interpreting the Statues CVC 40801-40805 / CEC 1271(C), Doubtful 2: They don’t give two structured object’s about traffic cases and will leave it to the justices to reverse if there was indeed a legal error, More likely.
However, in any case, it’s best that they didn’t respond with a rebuttal and hey, this saves me from having to do an oral argument in front of the Justice Panel, which I wouldn’t of minded for the learning experience.
Previous Post: http://controllingtheinter.net/2018/02/27/traffic-court-cvc-22350-basic-speed-law-continued-appellants-opening-brief/
Update: 
http://controllingtheinter.net/2018/06/18/waiting-on-results-from-appeal/