@@ -6095,8 +6095,15 @@ int32_t I2SPlayFile(const char *path, uint32_t decoder_type);
6095
6095
if (!strncmp_XP(lp, XPSTR("s2t("), 4)) {
6096
6096
lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0);
6097
6097
char str[SCRIPT_MAX_SBSIZE];
6098
- uint32_t secs = (uint32_t)fvar + (uint32_t)glob_script_mem.epoch_offset;
6099
- s2tstamp(str, SCRIPT_MAX_SBSIZE, secs, 0);
6098
+ while (*lp == ' ') lp++;
6099
+ if (*lp == 'i') {
6100
+ uint32_t secs = *(uint32_t*)&fvar;
6101
+ s2tstamp(str, SCRIPT_MAX_SBSIZE, secs, 0);
6102
+ lp++;
6103
+ } else {
6104
+ uint32_t secs = (uint32_t)fvar + (uint32_t)glob_script_mem.epoch_offset;
6105
+ s2tstamp(str, SCRIPT_MAX_SBSIZE, secs, 0);
6106
+ }
6100
6107
if (sp) strlcpy(sp, str, glob_script_mem.max_ssize);
6101
6108
len = 0;
6102
6109
goto strexit;
@@ -6267,7 +6274,14 @@ void tmod_directModeOutput(uint32_t pin);
6267
6274
if (!strncmp_XP(lp, XPSTR("tsn("), 4)) {
6268
6275
char str[SCRIPT_MAX_SBSIZE];
6269
6276
lp = GetStringArgument(lp + 4, OPER_EQU, str, 0);
6270
- fvar = tstamp2l(str) - (uint32_t)glob_script_mem.epoch_offset;
6277
+ while (*lp == ' ') lp++;
6278
+ if (*lp == 'i') {
6279
+ lp++;
6280
+ uint32_t result = tstamp2l(str);
6281
+ fvar = *(float*)&result;
6282
+ } else {
6283
+ fvar = tstamp2l(str) - (uint32_t)glob_script_mem.epoch_offset;
6284
+ }
6271
6285
goto nfuncexit;
6272
6286
}
6273
6287
#endif
0 commit comments