Code executes differently on Photon than on Core

Hi @codiak

I tried to reformat your code and output sections, but I don’t get why you have all the *'s in the code. It makes it really hard to read since * is an operator in C. Maybe a better cut-and-paste would help us figure out what is going on.

The problem of concatenating String objects is fixed on Photon but not on Core yet.

@bko This code was built with 0.4.4 and tested on the photon.

Ignore he splats,ignore them if you want… It was a quick hack to print the timeStr character for character.

Bottom line bug statement is

If you start a string with the results for timeStr eveu after is truncatred.
If you put timeStr as the last concat it works
Again this is on the photon, 0.4.4 local…

Ive got a work around in my real code. What i provided is just to demo the issue

I can verify that the bug is still present in 0.4.4-rc3. Just to clarify – the string concatenation works fine when compiling for Core (always has); this has always been a Photon only issue and an issue specifically when trying to concatenate a substring onto the end of the string returned by Time.timeStr().

I think this might be related to the fact that we remove the trailing newline in the 0.4.x series of firmware? I’ll add a unit test to be sure.

Update: Sorry about this, but I’m pleased to say it’s now fixed. it was due to the way we were removing the unwanted newline in the asctime() function that timeStr() uses.

This is fixed in the PR linked to the issue. This will be merged into the develop branch soon and released to the compile server with the 0.4.5 release, planned Wednesday next week.

4 Likes

Is the 0.4.5 release available outside of dev ?