Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
3944b2da
Commit
3944b2da
authored
Sep 24, 2020
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】9531板子上运行ncp程序串口无法通信,参照老版本程序复位一下底板(gpio11)
parent
92ffcb69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
.../zigbee/protocol/zigbee/app/framework/util/af-main-host.c
+52
-0
No files found.
platform/zigbee/protocol/zigbee/app/framework/util/af-main-host.c
View file @
3944b2da
...
...
@@ -48,6 +48,8 @@
#include "yjq_ezsp.h"
#include "./rpc_api/inc/rpc_interface_parse.h"
#include <pthread.h>
#include <fcntl.h>
pthread_mutex_t
g_mutex_lock
;
...
...
@@ -481,8 +483,58 @@ void emAfResetAndInitNCP(void)
// *******************************************************************
// The main() loop and the application's contribution.
static
void
gpio_output_set
(
int
val
,
int
gpio_num
)
{
char
str
[
120
]
=
{
0
};
int
re
=
0
;
memset
(
str
,
0
,
sizeof
(
str
));
snprintf
(
str
,
sizeof
(
str
),
"/sys/class/gpio/gpio%d"
,
gpio_num
);
if
((
access
(
str
,
F_OK
))
==
-
1
)
{
snprintf
(
str
,
sizeof
(
str
),
"echo %d > /sys/class/gpio/export"
,
gpio_num
);
re
=
system
(
str
);
if
(
re
!=
0
)
{
return
;
}
}
snprintf
(
str
,
sizeof
(
str
),
"echo out > /sys/class/gpio/gpio%d/direction"
,
gpio_num
);
re
=
system
(
str
);
if
(
re
!=
0
)
{
return
;
}
snprintf
(
str
,
sizeof
(
str
),
"echo %d > /sys/class/gpio/gpio%d/value"
,
val
==
false
?
0
:
1
,
gpio_num
);
re
=
system
(
str
);
if
(
re
!=
0
)
{
return
;
}
}
void
chip_reset
()
{
printf
(
"try reset chip
\n
"
);
gpio_output_set
(
false
,
11
);
sleep
(
1
);
gpio_output_set
(
true
,
11
);
sleep
(
1
);
}
void
emberAfMainInit
(
void
)
{
chip_reset
();
}
int
emberAfMain
(
MAIN_FUNCTION_PARAMETERS
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment