code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0) #if (RHINO_CONFIG_USER_SPACE > 0) void krhino_utask_free_res(ktask_t *task); #endif void dyn_mem_proc_task(void *arg) { CPSR_ALLOC(); size_t i; kstat_t ret; res_free_t *r...
YifuLiu/AliOS-Things
kernel/rhino/k_dyn_mem_proc.c
C
apache-2.0
1,478
/* * Copyright (C) 2015-2019 Alibaba Group Holding Limited */ #include "k_api.h" #if AOS_COMP_DEBUG #include "aos/debug.h" #endif void k_err_proc_debug(kstat_t err, char *file, int line) { #if AOS_COMP_DEBUG aos_debug_fatal_error(err, file, line); #endif if (g_err_proc != NULL) { g_err_proc(err); ...
YifuLiu/AliOS-Things
kernel/rhino/k_err.c
C
apache-2.0
328
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_EVENT_FLAG > 0) static kstat_t event_create(kevent_t *event, const name_t *name, uint32_t flags, uint8_t mm_alloc_flag) { #if (RHINO_CONFIG_KOBJ_LIST > 0) CPSR_ALLOC(); #endif NULL_PARA_CHK(event); NULL_P...
YifuLiu/AliOS-Things
kernel/rhino/k_event.c
C
apache-2.0
8,087
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include "k_api.h" #if (RHINO_CONFIG_CPU_USAGE_STATS > 0) void idle_count_set(idle_count_t value) { CPSR_ALLOC(); RHINO_CPU_INTRPT_DISABLE(); g_idle_count[cpu_cur_get()] = value; RHINO_CPU_INTRPT_ENABLE(); } idle_co...
YifuLiu/AliOS-Things
kernel/rhino/k_idle.c
C
apache-2.0
1,727
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include "k_api.h" #if AOS_COMP_DEBUG #include "aos/debug.h" extern uint32_t debug_task_id_now(); extern void debug_cpu_stop(void); #endif #if (RHINO_CONFIG_MM_TLF > 0) extern k_mm_region_t g_mm_region[]; extern i...
YifuLiu/AliOS-Things
kernel/rhino/k_mm.c
C
apache-2.0
24,550
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" kstat_t krhino_mblk_pool_init(mblk_pool_t *pool, const name_t *name, void *pool_start, size_t pool_size) { uint32_t blk_type; /* max blocks mem pool offers */ uint8_t align_mask; /* addres...
YifuLiu/AliOS-Things
kernel/rhino/k_mm_blk.c
C
apache-2.0
5,726
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include "k_api.h" #if AOS_COMP_DEBUG #include "aos/debug.h" #endif #define KMM_CRITICAL_ENTER(head, cpsr) MM_CRITICAL_ENTER(head, cpsr) #define KMM_CRITICAL_EXIT(head, cpsr) MM_CRITICAL_EXIT(head, cpsr) typedef int (*KMM_PRINT)(con...
YifuLiu/AliOS-Things
kernel/rhino/k_mm_debug.c
C
apache-2.0
12,130
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" kstat_t mutex_create(kmutex_t *mutex, const name_t *name, uint8_t mm_alloc_flag) { #if (RHINO_CONFIG_KOBJ_LIST > 0) CPSR_ALLOC(); #endif NULL_PARA_CHK(mutex); NULL_PARA_CHK(name); memset(mutex, 0, sizeof(kmutex_t)); ...
YifuLiu/AliOS-Things
kernel/rhino/k_mutex.c
C
apache-2.0
11,145
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" kstat_t g_sys_stat; uint8_t g_idle_task_spawned[RHINO_CONFIG_CPU_NUM]; runqueue_t g_ready_queue; /* schedule lock counter */ uint8_t g_sched_lock[RHINO_CONFIG_CPU_NUM]; uint8_t g_intrpt_nested_level[RHINO_CONFIG_CPU_NUM]; /* highest...
YifuLiu/AliOS-Things
kernel/rhino/k_obj.c
C
apache-2.0
2,426
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" RHINO_INLINE void pend_list_add(klist_t *head, ktask_t *task) { klist_t *tmp; klist_t *list_start = head; klist_t *list_end = head; for (tmp = list_start->next; tmp != list_end; tmp = tmp->next) { if (krhino_...
YifuLiu/AliOS-Things
kernel/rhino/k_pend.c
C
apache-2.0
3,982
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_QUEUE > 0) RHINO_INLINE void task_msg_recv(ktask_t *task, void *msg) { task->msg = msg; pend_task_wakeup(task); } static kstat_t queue_create(kqueue_t *queue, const name_t *name, void **start, ...
YifuLiu/AliOS-Things
kernel/rhino/k_queue.c
C
apache-2.0
9,248
/* * Copyright (C) 2015-2019 Alibaba Group Holding Limited */ #include "k_rbtree.h" static inline void rbtree_set_black(struct k_rbtree_node_t *rbt) { rbt->rbt_parent_color |= K_RBTREE_BLACK; } static inline void rbtree_rotate_set_parents(struct k_rbtree_node_t *old, struct k_rbtree_node_t *new, str...
YifuLiu/AliOS-Things
kernel/rhino/k_rbtree.c
C
apache-2.0
12,073
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #define RING_BUF_LEN sizeof(size_t) kstat_t ringbuf_init(k_ringbuf_t *p_ringbuf, void *buf, size_t len, size_t type, size_t block_size) { p_ringbuf->type = type; p_ringbuf->buf = buf; p_ringbu...
YifuLiu/AliOS-Things
kernel/rhino/k_ringbuf.c
C
apache-2.0
5,725
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_SYS_STATS > 0) static void sched_disable_measure_start(void) { /* start measure system lock time */ if (g_sched_lock[cpu_cur_get()] == 0u) { g_sched_disable_time_start = HR_COUNT_GET(); } } static...
YifuLiu/AliOS-Things
kernel/rhino/k_sched.c
C
apache-2.0
14,763
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_SEM > 0) static kstat_t sem_create(ksem_t *sem, const name_t *name, sem_count_t count, uint8_t mm_alloc_flag) { #if (RHINO_CONFIG_KOBJ_LIST > 0) CPSR_ALLOC(); #endif NULL_PARA_CHK(se...
YifuLiu/AliOS-Things
kernel/rhino/k_sem.c
C
apache-2.0
7,895
/* * Copyright (C) 2015-2018 Alibaba Group Holding Limited */ #include "k_api.h" #include "k_spin_lock.h" #if (RHINO_CONFIG_CPU_NUM > 1) /* not use for linuxhost */ #define DBG_PRINTF(...) //printf(__VA_ARGS__) #define KRHINO_SPINLOCK_FREE_VAL 0xB33FFFFFu #define KRHINO_SPINLOCK_MAGIC_VAL 0xB33F...
YifuLiu/AliOS-Things
kernel/rhino/k_spin_lock.c
C
apache-2.0
5,547
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include <stdio.h> #include "k_api.h" #if (RHINO_CONFIG_KOBJ_LIST > 0) void kobj_list_init(void) { klist_init(&(g_kobj_list.task_head)); klist_init(&(g_kobj_list.mutex_head)); #if (RHINO_CONFIG_SEM > 0) klist_init(&(g_kobj_list.sem_head)); ...
YifuLiu/AliOS-Things
kernel/rhino/k_stats.c
C
apache-2.0
6,610
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" RHINO_INLINE void rhino_stack_check_init(void) { #if (RHINO_CONFIG_INTRPT_STACK_OVF_CHECK > 0) #if (RHINO_CONFIG_CPU_STACK_DOWN > 0) g_intrpt_stack_bottom = (cpu_stack_t *)RHINO_CONFIG_INTRPT_STACK_TOP; *g_intrpt_stack_bottom ...
YifuLiu/AliOS-Things
kernel/rhino/k_sys.c
C
apache-2.0
8,131
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_SCHED_CFS > 0) static void task_policy_change(ktask_t *task, uint8_t new_pri) { if ((new_pri >= RT_MIN_PRI) && (new_pri <= RT_MAX_PRI)) { if (task->sched_policy == KSCHED_CFS) { task->sched_pol...
YifuLiu/AliOS-Things
kernel/rhino/k_task.c
C
apache-2.0
31,799
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_TASK_SEM > 0) kstat_t krhino_task_sem_create(ktask_t *task, ksem_t *sem, const name_t *name, size_t count) { kstat_t ret; if (task == NULL) { return RHINO_NULL_PTR; ...
YifuLiu/AliOS-Things
kernel/rhino/k_task_sem.c
C
apache-2.0
1,226
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" void tick_list_init(void) { klist_init(&g_tick_head); } RHINO_INLINE void tick_list_pri_insert(klist_t *head, ktask_t *task) { tick_t val; klist_t *q; klist_t *list_start; klist_t *list_end; ktask_t *task_iter...
YifuLiu/AliOS-Things
kernel/rhino/k_tick.c
C
apache-2.0
3,106
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" void krhino_tick_proc(void) { #if (RHINO_CONFIG_USER_HOOK > 0) krhino_tick_hook(); #endif tick_list_update(1); #if (RHINO_CONFIG_SCHED_RR > 0) time_slice_update(); #endif } tick_t krhino_sys_tick_get(void) { CPSR_ALL...
YifuLiu/AliOS-Things
kernel/rhino/k_time.c
C
apache-2.0
1,164
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_TIMER > 0) static void timer_list_pri_insert(klist_t *head, ktimer_t *timer) { tick_t val; klist_t *q; klist_t *start; klist_t *end; ktimer_t *task_iter_temp; start = head; end = h...
YifuLiu/AliOS-Things
kernel/rhino/k_timer.c
C
apache-2.0
10,289
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited */ #include "k_api.h" #if (RHINO_CONFIG_WORKQUEUE > 0) static kstat_t workqueue_is_exist(kworkqueue_t *workqueue) { CPSR_ALLOC(); kworkqueue_t *pos; RHINO_CRITICAL_ENTER(); for (pos = krhino_list_entry(g_workqueue_list_head.next, kworkqueu...
YifuLiu/AliOS-Things
kernel/rhino/k_workqueue.c
C
apache-2.0
7,638
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) $(CPRE) rm -rf aos_sdk ...
YifuLiu/AliOS-Things
solutions/amp_demo/Makefile
Makefile
apache-2.0
358
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/amp_demo/SConstruct
Python
apache-2.0
302
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/errno.h> #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> extern int amp_main(void); int application_start(int argc, char *argv[]) { int count = 0; aos_task_...
YifuLiu/AliOS-Things
solutions/amp_demo/amp_entry.c
C
apache-2.0
507
/* user space */ #ifndef RHINO_CONFIG_USER_SPACE #define RHINO_CONFIG_USER_SPACE 0 #endif
YifuLiu/AliOS-Things
solutions/amp_demo/k_app_config.h
C
apache-2.0
106
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/amp_demo/maintask.c
C
apache-2.0
1,192
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) $(CPRE) find . -name "*...
YifuLiu/AliOS-Things
solutions/audio_demo/Makefile
Makefile
apache-2.0
397
Import('defconfig') defconfig.library_yaml()
YifuLiu/AliOS-Things
solutions/audio_demo/SConscript
Python
apache-2.0
45
#! /bin/env python from aostools import Make defconfig = Make(elf='aos.elf', objcopy='binary/audio_demo@haas100.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/audio_demo/SConstruct
Python
apache-2.0
171
/* * Copyright (C) 2015-2019 Alibaba Group Holding Limited * */ #include "k_api.h" #if AOS_COMP_CLI #include "aos/cli.h" #endif #include "ulog/ulog.h" #include "uvoice_init.h" #include "uvoice_test.h" void cmd_tts_handler(char *buf, int len, int argc, char **argv) { /* >> tts "我爱你中国" /data/tts.mp3 */ extern...
YifuLiu/AliOS-Things
solutions/audio_demo/audio_api.c
C
apache-2.0
1,997
/* * 这个例程演示了用SDK配置MQTT参数并建立连接, 之后创建2个线程 * * + 一个线程用于保活长连接 * + 一个线程用于接收消息, 并在有消息到达时进入默认的数据回调, 在连接状态变化时进入事件回调 * * 接着演示了在MQTT连接上进行属性上报, 事件上报, 以及处理收到的属性设置, 服务调用, 取消这些代码段落的注释即可观察运行效果 * * 需要用户关注或修改的部分, 已经用 TODO 在注释中标明 * */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <aos/kernel.h> #include...
YifuLiu/AliOS-Things
solutions/audio_demo/data_model_basic_demo.c
C
apache-2.0
20,566
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ /** * @file main.c * * This file includes the entry code of link sdk related demo * */ #include <string.h> #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "netmgr.h" #include <uservice/uservice.h> #include <uservice/eventid...
YifuLiu/AliOS-Things
solutions/audio_demo/main.c
C
apache-2.0
1,218
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* * If board have no component for example board_x...
YifuLiu/AliOS-Things
solutions/audio_demo/maintask.c
C
apache-2.0
1,197
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif MK_GENERATED_IMGS_PATH:=generated PRODUCT_BIN:=product .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo YoC SDK Done @echo [INFO] Create bin files # $(CPRE) $(PRO...
YifuLiu/AliOS-Things
solutions/auto_demo/Makefile
Makefile
apache-2.0
892
Import('defconfig') defconfig.library_yaml()
YifuLiu/AliOS-Things
solutions/auto_demo/SConscript
Python
apache-2.0
45
#! /bin/env python from aostools import Make # defconfig = Make(elf='yoc.elf', objcopy='generated/data/prim', objdump='yoc.asm') defconfig = Make(elf='aos.elf', objcopy='binary/auto_demo@haas100.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/auto_demo/SConstruct
Python
apache-2.0
254
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "auto_app.h" #include "k_api.h" #if AOS_COMP_CLI #include "aos/cli.h" #endif #include <sys/ioctl.h> #include <vfsdev/gpio_dev.h> #include <drivers/char/u_device.h> #include <drive...
YifuLiu/AliOS-Things
solutions/auto_demo/auto_app.c
C
apache-2.0
4,931
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #ifndef AUTO_APP_H #define AUTO_APP_H void right_ctl(void); void left_ctl(void); void back_ctl(void); void front_ctl(void); void stop_ctl(void); int auto_app_init(void); #endif
YifuLiu/AliOS-Things
solutions/auto_demo/auto_app.h
C
apache-2.0
245
/* * 这个例程演示了用SDK配置MQTT参数并建立连接, 之后创建2个线程 * * + 一个线程用于保活长连接 * + 一个线程用于接收消息, 并在有消息到达时进入默认的数据回调, 在连接状态变化时进入事件回调 * * 接着演示了在MQTT连接上进行属性上报, 事件上报, 以及处理收到的属性设置, 服务调用, 取消这些代码段落的注释即可观察运行效果 * * 需要用户关注或修改的部分, 已经用 TODO 在注释中标明 * */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <aos/kernel.h> #include...
YifuLiu/AliOS-Things
solutions/auto_demo/data_model_basic_demo.c
C
apache-2.0
16,885
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ /** * @file main.c * * This file includes the entry code of link sdk related demo * */ #include <string.h> #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "netmgr.h" #include <uservice/uservice.h> #include <uservice/eventid...
YifuLiu/AliOS-Things
solutions/auto_demo/main.c
C
apache-2.0
1,248
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/auto_demo/maintask.c
C
apache-2.0
1,192
#!/usr/bin/env python # -*- encoding: utf-8 -*- # version 1.0.1 import os import sys import re import codecs import time import json import argparse import inspect from ymodemfile import YModemfile try: import serial from serial.tools import miniterm from serial.tools.list_ports import comports except: ...
YifuLiu/AliOS-Things
solutions/block_demo/.utility/python/transymodem.py
Python
apache-2.0
7,164
#! /usr/bin/env python # -*- coding: utf-8 -*- #version 1.0.0 """ MIT License Copyright (c) 2018 Alex Woo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without li...
YifuLiu/AliOS-Things
solutions/block_demo/.utility/python/ymodemfile.py
Python
apache-2.0
18,669
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) $(CPRE) find . -name "*...
YifuLiu/AliOS-Things
solutions/eduk1_demo/Makefile
Makefile
apache-2.0
397
#! /bin/env python from aostools import Make # defconfig = Make(elf='yoc.elf', objcopy='generated/data/prim', objdump='yoc.asm') defconfig = Make(elf='aos.elf', objcopy='aos.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/eduk1_demo/SConstruct
Python
apache-2.0
233
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include "k1_apps/menu.h" #include <aos/errno.h> #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> #include <uservice/eventid.h> // #include "drivers/lcd/st7789v/st7789v_vfs.h" // #i...
YifuLiu/AliOS-Things
solutions/eduk1_demo/app_start.c
C
apache-2.0
2,053
#define BUILD_VERSION "1.1.0"
YifuLiu/AliOS-Things
solutions/eduk1_demo/build_version.h
C
apache-2.0
30
#include "aircraftBattle.h" #include <stdio.h> #include <stdlib.h> MENU_COVER_TYP aircraftBattle_cover = {MENU_COVER_FUNC, NULL, NULL, aircraftBattle_cover_draw}; MENU_TASK_TYP aircraftBattle_tasks = {aircraftBattle_init, aircraftBattle_unin...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/aircraftBattle/aircraftBattle.c
C
apache-2.0
22,523
#ifndef __AIRCRAFTBATTLE_H__ #define __AIRCRAFTBATTLE_H__ #include "../menu.h" extern MENU_TYP aircraftBattle; int aircraftBattle_init(void); int aircraftBattle_uninit(void); void aircraftBattle_task(void); void aircraftBattle_key_handel(key_code_t key_code); void aircraftBattle_cover_draw(int *draw_index); /* ...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/aircraftBattle/aircraftBattle.h
C
apache-2.0
21,056
#include "barometer.h" #include "drv_baro_qst_qmp6988.h" #include "drv_baro_goertek_spl06.h" #include <stdio.h> #include <stdlib.h> static char pressure_str[16] = " "; static char altitude_str[16] = " "; static char Ctemp_str[7] = " "; static char Ftemp_str[7] = " "; static spl0...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/barometer/barometer.c
C
apache-2.0
3,464
#ifndef __BAROMETER_H__ #define __BAROMETER_H__ #include "../menu.h" extern MENU_TYP barometer; int barometer_init(void); int barometer_uninit(void); void barometer_task(void); static uint8_t icon_data_tempF_16_16[] = { 0x00, 0x00, 0x00, 0x38, 0x28, 0x38, 0x00, 0xF8, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x08, 0x...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/barometer/barometer.h
C
apache-2.0
1,441
#include "compass.h" #include "drv_mag_qst_qmc5883l.h" #include "drv_mag_qst_qmc6310.h" #include <stdio.h> #include <stdlib.h> #define COMPASS_CENTER_X 38 #define COMPASS_CENTER_Y 32 // 严格限制长度 static char code_str[3] = " "; // ES static char number_str[4] = " "; // 329 static int heading = 0; static...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/compass/compass.c
C
apache-2.0
3,613
#ifndef __COMPASS_H__ #define __COMPASS_H__ #include "../menu.h" extern MENU_TYP compass; int compass_init(void); int compass_uninit(void); void compass_task(void); static uint8_t icon_data_compass_55_55[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0C, ...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/compass/compass.h
C
apache-2.0
3,370
#include "greedySnake.h" #include <stdio.h> #include <stdlib.h> MENU_COVER_TYP greedySnake_cover = {MENU_COVER_FUNC, NULL, NULL, greedySnake_cover_draw}; MENU_TASK_TYP greedySnake_tasks = {greedySnake_init, greedySnake_uninit}; MENU_TYP greedySnake = {"greedySnake", &greedySnake_co...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/greedySnake/greedySnake.c
C
apache-2.0
13,996
#ifndef __GREEFYSNAKE_H__ #define __GREEFYSNAKE_H__ #include "../menu.h" extern MENU_TYP greedySnake; void StartGame(void); int greedySnake_init(void); int greedySnake_uninit(void); void greedySnake_task(void); void greedySnake_key_handel(key_code_t key_code); ...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/greedySnake/greedySnake.h
C
apache-2.0
3,335
#include "gyroscope.h" #include "drv_acc_gyro_inv_mpu6050.h" #include "drv_acc_gyro_qst_qmi8610.h" #include <stdio.h> #include <stdlib.h> MENU_COVER_TYP gyroscope_cover = {MENU_COVER_NONE}; MENU_TASK_TYP gyroscope_tasks = {gyroscope_init, gyroscope_uninit}; MENU_TYP gyroscope = {"gyroscope", &gyroscope_cover, &gyrosc...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/gyroscope/gyroscope.c
C
apache-2.0
2,854
#ifndef __GYROSCOPE_H__ #define __GYROSCOPE_H__ #include "../menu.h" extern MENU_TYP gyroscope; int gyroscope_init(void); int gyroscope_uninit(void); void gyroscope_task(void); #endif
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/gyroscope/gyroscope.h
C
apache-2.0
190
#include "homepage.h" #include "../menu.h" #include "aos/kernel.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include "posix/timer.h" #include "../../build_version.h" #include "netmgr.h" #include "aos/vfs.h" #include <drivers/u_ld.h> #include <vfsdev/adc_dev.h> #include <drivers/char/u_device.h> static...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/homepage/homepage.c
C
apache-2.0
4,517
#ifndef __HOMEPAGE_H__ #define __HOMEPAGE_H__ #include "../menu.h" extern MENU_TYP homepage; static uint8_t icon_data_battery0_20_12[] = { 0x00, 0xFC, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xFC, 0xF8, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/homepage/homepage.h
C
apache-2.0
2,526
#include "humiture.h" #include "drv_temp_humi_si_si7006.h" #include "drv_temp_humi_sensylink_cht8305.h" #include "../menu.h" MENU_COVER_TYP humiture_cover = {MENU_COVER_NONE}; MENU_TASK_TYP humiture_tasks = {humiture_init, humiture_uninit}; MENU_TYP humiture = {"humiture", &humiture_cover, &humiture_tasks, NULL, NULL...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/humiture/humiture.c
C
apache-2.0
2,143
#ifndef __HUMITURE_H__ #define __HUMITURE_H__ #include "../menu.h" extern MENU_TYP humiture; int humiture_init(void); int humiture_uninit(void); void humiture_task(void); static uint8_t icon_data_hygrometer_24_24[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x01, 0xFE, 0x00, 0x24, 0x24, 0x24, 0x2...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/humiture/humiture.h
C
apache-2.0
1,441
/* * Copyright (C) 2020-2023 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <ulog/ulog.h> #include <vfsdev/pwm_dev.h> void beeper_start(uint16_t port, uint16_t frequency, uint16_t duration) { int ret = -1; int fd = 0; char name[16] = {0}; float d...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/kws/beeper/beeper.c
C
apache-2.0
1,434
#ifndef _BEEPER_H_ #define _BEEPER_H_ #include <stdint.h> void beeper_start(uint16_t port, uint16_t frequency, uint16_t duration); void beeper_stop(uint16_t port); #endif
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/kws/beeper/beeper.h
C
apache-2.0
176
#!/usr/bin/env python3 import os import sys import getpass import shutil #!/usr/bin/env python3 import os import sys import getpass import shutil comp_path = sys.path[0] print("comp_path:") print(comp_path) # original folder src_mp3_path = comp_path + "/resources/mp3" # new folder data_path = comp_path + "/../../...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/kws/cp_resources.py
Python
apache-2.0
650
#include "kws.h" #include "../menu.h" #include "aiagent_service.h" #include "aiagent_common.h" #include "beeper/beeper.h" #define TAG "kws" #include "uvoice_init.h" #include "uvoice_types.h" #include "uvoice_event.h" #include "uvoice_player.h" #include "uvoice_recorder.h" #include "uvoice_os.h" MENU_COVER_TYP kws_co...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/kws/kws.c
C
apache-2.0
4,975
#ifndef __KWS_H__ #define __KWS_H__ #include "../menu.h" extern MENU_TYP kws; int32_t kws_init(void); int32_t kws_uninit(void); #endif
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/kws/kws.h
C
apache-2.0
139
#include "lightmeter.h" #include "drv_als_ps_ir_liteon_ap3216c.h" #include "aos/kernel.h" #include <stdio.h> #include <stdlib.h> MENU_COVER_TYP lightmeter_cover = {MENU_COVER_NONE}; MENU_TASK_TYP lightmeter_tasks = {lightmeter_init, lightmeter_uninit}; MENU_LIST_TYP lightmeter_child_list = {NULL, 0}; MENU_...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/lightmeter/lightmeter.c
C
apache-2.0
2,054
#ifndef __LIGHTMETER_H__ #define __LIGHTMETER_H__ #include "../menu.h" static uint8_t icon_data_lighter_24_24[] = { 0x00, 0xC0, 0xF0, 0x18, 0x0C, 0x24, 0x46, 0x86, 0x02, 0x00, 0x00, 0x00, 0x10, 0x50, 0x50, 0x92, 0x26, 0x46, 0x84, 0x0C, 0x18, 0xF0, 0xC0, 0x00, 0x00, 0x81, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/lightmeter/lightmeter.h
C
apache-2.0
2,264
#include <stdio.h> #include <stdlib.h> #include "aos/kernel.h" #include "menu.h" // 添加离自己最近的子级目录 #include "aircraftBattle/aircraftBattle.h" #include "barometer/barometer.h" #include "compass/compass.h" #include "greedySnake/greedySnake.h" #include "gyroscope/gyroscope.h" #include "homepage/homepage.h" #include "humit...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/menu.c
C
apache-2.0
12,580
#ifndef __MENU_H__ #define __MENU_H__ #include "key.h" #include "sh1106.h" #include <stdio.h> #include "aos/kernel.h" extern uint8_t g_haasedu_boardname; extern int g_haasboard_is_k1c; typedef int MENU_ID_TYP; #ifdef EDU_TAG #undef EDU_TAG #endif #define EDU_TAG "eduk1_demo" typedef enum { MENU_TASK_IDLE, ME...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/menu.h
C
apache-2.0
10,611
#include "musicbox.h" #include <stdio.h> #include <stdlib.h> #include <vfsdev/pwm_dev.h> MENU_COVER_TYP musicbox_cover = {MENU_COVER_FUNC, NULL, NULL, musicbox_cover_draw, 0}; MENU_TASK_TYP musicbox_tasks = {musicbox_init, musicbox_uninit}; MENU_TYP musicbox = {"musicbox",...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/musicbox/musicbox.c
C
apache-2.0
6,989
#ifndef __MUSICBOX_H__ #define __MUSICBOX_H__ #include "../menu.h" #include "pitches.h" extern MENU_TYP musicbox; typedef struct { char *name; int *notes; int *noteDurations; unsigned int noteLength; unsigned int musicTime; } music_t; typedef struct { music_t **music_list; unsigned int m...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/musicbox/musicbox.h
C
apache-2.0
6,340
#define NOTE_B0 31 #define NOTE_C1 33 #define NOTE_CS1 35 #define NOTE_D1 37 #define NOTE_DS1 39 #define NOTE_E1 41 #define NOTE_F1 44 #define NOTE_FS1 46 #define NOTE_G1 49 #define NOTE_GS1 52 #define NOTE_A1 55 #define NOTE_AS1 58 #define NOTE_B1 62 #define NOTE_C2 65 #define NOTE_CS2 69 #define NOTE_D2 73 ...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/musicbox/pitches.h
C
apache-2.0
1,895
#include "shakeshake.h" #include "drv_acc_gyro_inv_mpu6050.h" #include "drv_acc_gyro_qst_qmi8610.h" #include <stdio.h> #include <stdlib.h> #define SHAKE_Z_THRESHOLD 5000 #define SHAKE_Y_THRESHOLD 4000 MENU_COVER_TYP shakeshake_cover = {MENU_COVER_NONE}; MENU_TASK_TYP shakeshake_tasks = {shakeshake_init, shakeshake_u...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/shakeshake/shakeshake.c
C
apache-2.0
2,632
#ifndef __SHAKESHAKE_H__ #define __SHAKESHAKE_H__ #include "../menu.h" extern MENU_TYP shakeshake; int shakeshake_init(void); int shakeshake_uninit(void); void shakeshake_task(void); static uint8_t icon_data_shakeshake_32_32[128] = { 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x30, 0x30, ...
YifuLiu/AliOS-Things
solutions/eduk1_demo/k1_apps/shakeshake/shakeshake.h
C
apache-2.0
3,115
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> #include "build_version.h" #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no compo...
YifuLiu/AliOS-Things
solutions/eduk1_demo/maintask.c
C
apache-2.0
2,185
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif MK_GENERATED_IMGS_PATH:=generated PRODUCT_BIN:=product .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo YoC SDK Done @echo [INFO] Create bin files # $(CPRE) $(PRO...
YifuLiu/AliOS-Things
solutions/flower_demo/Makefile
Makefile
apache-2.0
885
Import('defconfig') defconfig.library_yaml()
YifuLiu/AliOS-Things
solutions/flower_demo/SConscript
Python
apache-2.0
45
#! /bin/env python from aostools import Make # defconfig = Make(elf='yoc.elf', objcopy='generated/data/prim', objdump='yoc.asm') defconfig = Make(elf='aos.elf', objcopy='binary/flower_demo@haas100.bin') Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/flower_demo/SConstruct
Python
apache-2.0
256
/* * 这个例程演示了用SDK配置MQTT参数并建立连接, 之后创建2个线程 * * + 一个线程用于保活长连接 * + 一个线程用于接收消息, 并在有消息到达时进入默认的数据回调, 在连接状态变化时进入事件回调 * * 接着演示了在MQTT连接上进行属性上报, 事件上报, 以及处理收到的属性设置, 服务调用, 取消这些代码段落的注释即可观察运行效果 * * 需要用户关注或修改的部分, 已经用 TODO 在注释中标明 * */ #include <stdio.h> #include <string.h> #include <unistd.h> #include <aos/kernel.h> #include...
YifuLiu/AliOS-Things
solutions/flower_demo/data_model_basic_demo.c
C
apache-2.0
16,368
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "flower_app.h" #include "k_api.h" #if AOS_COMP_CLI #include "aos/cli.h" #endif #include <sys/ioctl.h> #include <vfsdev/gpio_dev.h> #include <drivers/char/u_device.h> #include <dri...
YifuLiu/AliOS-Things
solutions/flower_demo/flower_app.c
C
apache-2.0
5,473
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #ifndef FLOWER_APP_H #define FLOWER_APP_H int flower_gpio_init(void); void report_2_cloud(void *dm_handle); #endif
YifuLiu/AliOS-Things
solutions/flower_demo/flower_app.h
C
apache-2.0
183
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ /** * @file main.c * * This file includes the entry code of link sdk related demo * */ #include <string.h> #include <stdio.h> #include <aos/kernel.h> #include "ulog/ulog.h" #include "netmgr.h" #include <uservice/uservice.h> #include <uservice/eventid...
YifuLiu/AliOS-Things
solutions/flower_demo/main.c
C
apache-2.0
1,281
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/flower_demo/maintask.c
C
apache-2.0
1,192
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MAKEFLAGS) -j4 @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) ifeq ($(OS), Windows_NT) $(CPRE) if...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/Makefile
Makefile
apache-2.0
587
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/app/src/maintask.c
C
apache-2.0
1,192
/* * Copyright (C) 2019-2020 Alibaba Group Holding Limited */ #include "common/log.h" #include <stdio.h> #include <string.h> #include <ctype.h> // #include <aos/aos.h> #include <aos/kernel.h> // #include <misc/printk.h> // #include <misc/byteorder.h> // #include <aos/hal/gpio.h> // #include <aos/hal/pwm.h> // #in...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/light_ctl/light.c
C
apache-2.0
19,040
#ifndef __LIGHT_H__ #define __LIGHT_H__ #ifndef CONFIG_INFO_DISABLE #define LIGHT_DBG(fmt, ...) printf("[%s]" fmt "\n", __func__, ##__VA_ARGS__) #else #define LIGHT_DBG(fmt, ...) #endif #define LED_BLINK_PERIOD 1000 #define LED_BLINK_ON_TIME 600 #define LED_BLINK_OFF_TIME 400 /* unprovision device beacon adv time : ...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/light_ctl/light.h
C
apache-2.0
720
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/errno.h> #include <aos/kernel.h> #include <aos/gpioc.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> #include "light_driver.h" // PA_28 #define RED_LED (28) // PB_4 #define GREEN_LED (4)...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/light_ctl/light_driver.c
C
apache-2.0
2,187
#ifndef __LIGHT_DRIVER_H__ #define __LIGHT_DRIVER_H__ // #define WARM_PIN 24 //warm led // #define COLD_PIN 20 //cold led // #define COLD_PORT_NUM 0 // #define WARM_PORT_NUM 1 // #define PWM_CHANNEL_COUNT 2 // #define LIGHT_PERIOD 500 // void light_driver_init(void); // void light_driver_update(uint8_t onoff, uint...
YifuLiu/AliOS-Things
solutions/genie_mesh_demo/light_ctl/light_driver.h
C
apache-2.0
453
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) ifeq ($(OS), Windows_NT)...
YifuLiu/AliOS-Things
solutions/haas_dev_demo/Makefile
Makefile
apache-2.0
599
#! /bin/env python from aostools import Make # default elf is out/<solution>@<board>.elf, and default objcopy is out/<solution>@<board>.bin # defconfig = Make(elf='out/<solution>@<board>.elf', objcopy='out/<solution>@<board>.bin') defconfig = Make() Export('defconfig') defconfig.build_components()
YifuLiu/AliOS-Things
solutions/haas_dev_demo/SConstruct
Python
apache-2.0
303
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include "aos/init.h" #include "board.h" #include <aos/errno.h> #include <aos/kernel.h> #include <k_api.h> #include <stdio.h> #include <stdlib.h> #include <uservice/uservice.h> #include <uservice/eventid.h> #include "aos/cli.h" #include "haas_main.h" #de...
YifuLiu/AliOS-Things
solutions/haas_dev_demo/haas_dev_demo.c
C
apache-2.0
1,525
/* user space */ #ifndef RHINO_CONFIG_USER_SPACE #define RHINO_CONFIG_USER_SPACE 0 #endif
YifuLiu/AliOS-Things
solutions/haas_dev_demo/k_app_config.h
C
apache-2.0
106
/* * Copyright (C) 2015-2020 Alibaba Group Holding Limited */ #include <stdio.h> #include <stdlib.h> #include <aos/kernel.h> #include "aos/init.h" #include "board.h" #include <k_api.h> #ifndef AOS_BINS extern int application_start(int argc, char *argv[]); #endif /* If board have no component for example board_xx_i...
YifuLiu/AliOS-Things
solutions/haas_dev_demo/maintask.c
C
apache-2.0
1,192
CPRE := @ ifeq ($(V),1) CPRE := VERB := --verbose endif .PHONY:startup startup: all all: @echo "Build Solution by $(BOARD) " $(CPRE) scons $(VERB) --board=$(BOARD) $(MULTITHREADS) $(MAKEFLAGS) @echo AOS SDK Done sdk: $(CPRE) aos sdk .PHONY:clean clean: $(CPRE) scons -c --board=$(BOARD) ifeq ($(OS), Windows_NT)...
YifuLiu/AliOS-Things
solutions/helloworld_demo/Makefile
Makefile
apache-2.0
599