| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #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;
- }
|