Skip to content

Commit fddcfa7

Browse files
miyatsuAnas Nashif
authored andcommitted
doc: Replace nano_sem with k_sem
The struct nano_sem is obsolete, so replace with struct k_sem. Signed-off-by: Ding Tao <[email protected]>
1 parent b53d697 commit fddcfa7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/subsystems/networking/connectivity-example-app.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ struct sockaddr_in6 my_addr6 = { 0 };
1818
struct net_context *context;
1919
int ret;
2020

21-
struct nano_sem quit_lock;
21+
struct k_sem waiter;
2222

2323
static inline void quit(void)
2424
{
25-
nano_sem_give(&quit_lock);
25+
k_sem_give(&waiter);
2626
}
2727

2828
static inline void init_app(void)
2929
{
30-
nano_sem_init(&quit_lock);
30+
k_sem_init(&waiter, 0, 1);
3131

3232
/* Add our address to the network interface */
3333
net_if_ipv6_addr_add(net_if_get_default(), &in6addr_my,
@@ -46,7 +46,7 @@ void main(void)
4646

4747
receive_data();
4848

49-
nano_sem_take(&quit_lock, TICKS_UNLIMITED);
49+
k_sem_take(&waiter, K_FOREVER);
5050

5151
close_context();
5252

0 commit comments

Comments
 (0)