FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uTensor/src/uTensor/core/uTensor_util.cpp at develop · uTensor/uTensor · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
uTensor
/
uTensor
Public
Notifications
You must be signed in to change notification settings
Fork
250
Star
1.9k
Code
Issues
51
Pull requests
5
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
uTensor
/
src
/
uTensor
/
core
/
uTensor_util.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (63 loc) · 1.24 KB
Breadcrumbs
uTensor
/
src
/
uTensor
/
core
/
uTensor_util.cpp
Copy path
File metadata and controls
73 lines (63 loc) · 1.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
include
"
uTensor/core/uTensor_util.hpp
"
#
if
!(defined(TARGET_MBED) || defined(ARDUINO))
//
#include <dirent.h>
//
#include <sys/stat.h>
#
endif
#
include
<
cstdlib
>
void
return_error
(
int
ret_val) {
if
(ret_val) {
uTensor_printf
(
"
[**Failure**] %d
\r\n
"
, ret_val);
uTensor_printf
(
"
Exiting...
\r\n
"
);
fflush
(stdout);
exit
(-
1
);
}
else
{
uTensor_printf
(
"
[DONE]
\r\n
"
);
}
}
/*
void printVector(std::vector<uint32_t> vec) {
printf("vector: \r\n");
for (uint32_t i : vec) {
printf("%d ", (unsigned int)i);
}
printf("\r\n");
}
*/
uint16_t
ntoh16
(
uint16_t
val) {
uint16_t
ret =
0
;
ret |= val >>
8
;
ret |= val <<
8
;
return
ret;
}
uint32_t
ntoh32
(
uint32_t
val) {
const
uint32_t
mask =
0b11111111
;
uint32_t
ret =
0
;
ret |= val >>
24
;
ret |= (val & (mask <<
16
)) >>
8
;
ret |= (val & (mask <<
8
)) <<
8
;
ret |= val <<
24
;
return
ret;
}
#
ifdef
ARDUINO
void
int_env
() {}
#
else
void
init_env
() {
//
int status;
//
DIR* dir = opendir("/fs/tmp");
//
if (dir) {
//
closedir(dir);
//
return;
//
} else {
//
status = mkdir("/fs/tmp", 0777);
//
if (status == -1) {
//
ERR_EXIT("env setting failed");
//
}
//
}
}
#
endif
void
utensor_exit
(
void
) {
#
ifndef
__EMSCRIPTEN__
exit
(-
1
);
#
endif
while
(
true
){}
}
Back
|
FazBrowse Home
|
New Git URL