#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

uint32_t timerProgress = 0;
uint32_t timerUpdate = 0;
uint8_t progress = 0;

uint32_t millis()
{
  return xTaskGetTickCount() * 10;
}

void setProgress(uint8_t value) {
  progress += value;
  if (progress >= 100)
    progress = 0;
}

uint8_t getProgress()
{
  return progress;
}

void app_main() {
  timerUpdate = millis();
  timerProgress = millis();

  while (true) {
    if (millis() - timerUpdate >= 200) {
      timerUpdate = millis();
      setProgress(1);
    }

     if (millis() - timerProgress >= 200) {
      timerProgress = millis();
      printf("%d\n", getProgress());
    }
  }
}