#include "stdio.h"
#include "stdint.h"
#include "soft/debug.h"
#include "stddef.h"
#include "main.h"








static void save_data(const char *filename,const uint8_t *buff,uint32_t size)
{
    FILE* fp;
    fp = fopen(filename, "wb");
    fwrite(buff, size, 1, fp);
    fclose(fp);
}



int thread_fun(void* t) {
  int argc;
  char** argv;
  char buff[10240] = { 0 };
  int index = 0;
  argc = get_argv(&argv);
  DBG_LOG("argc=%d, ",argc);
  for (int i = 0;i < argc;i++) {
    DBG_LOG("%s", argv[i]);
    index += sprintf(&buff[index],"%s ", argv[i]);
  }
  save_data("argv.log", buff, index);
  return 0;
}