Add PushCurrentTicks

This commit is contained in:
Felipe Martinez 2024-07-08 21:37:23 +00:00
parent b55b59ea13
commit ff4607c6da
2 changed files with 7 additions and 2 deletions

View file

@ -351,7 +351,7 @@ void ASM::run() {
break;
}
case OpcodeShort::PushCurrentTime: {
case OpcodeShort::PushCurrentDateTime: {
auto time = dateTimeController.CurrentDateTime();
std::tm tm {
.tm_sec = dateTimeController.Seconds(),
@ -368,6 +368,10 @@ void ASM::run() {
break;
}
case OpcodeShort::PushCurrentTicks:
push(std::make_shared<ValueInteger>((xTaskGetTickCount() * configTICK_RATE_HZ) / 1000));
break;
case OpcodeShort::FormatDateTime: {
auto fmt = pop<ValueString>(String);
auto time = pop<ValueDateTime>(DateTime);

View file

@ -144,7 +144,8 @@ namespace Pinetime {
PushU24,
PushU32,
PushEmptyString,
PushCurrentTime,
PushCurrentDateTime,
PushCurrentTicks,
Duplicate,
Pop,
LoadString,