| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <string.h>
- #include <limits.h>
- #include "rtdbg.h"
- #include "sys.h"
- #include "paras.h"
- #include "cfg.h"
- #include "fs.h"
- #include "thread.h"
- #if 1
- #define LOGE LOG_E
- #define LOGW LOG_W
- #define LOGD LOG_D
- #else
- #define LOGD rt_printf
- #define LOGW rt_printf
- #define LOGE rt_printf
- #endif
- ////////////////////////////////////////////////////////////////////
- int sys_reboot(void)
- {
- int r=0;
- r = system("reboot");
- if(r) {
- LOGE("sys_reboot failed!\n");
- return -1;
- }
- return r;
- }
- int sys_get_chip_id(int *id)
- {
- if(!id) {
- return -1;
- }
-
- return 0;
- }
- static void* poll_thread(void *arg)
- {
- thread_handle_t *h=(thread_handle_t*)arg;
- //wdog_init();
- //tmp_create();
- while(h->quit==0) {
- sleep(1);
- }
- pthread_exit(NULL);
- }
- int sys_init(void)
- {
- paras_init();
-
- //thread_start(THREAD_ID_POLL, poll_thread, NULL);
- return 0;
- }
|