Skip to content

Instantly share code, notes, and snippets.

#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
void anonymous_task(void * pvParameters)
{
fio_printf(1, "\r\n\n");
fio_printf(1, "I am a new task, and i do nothing:)\r\n");
}
void new_command(int n, char * argv[])
{
xTaskCreate(anonymous_task,
(signed portCHAR *) "NEW",
512 /* stack size */,
// fio.h line 15
#define MAX_FDS 32
typedef ssize_t (*fdread_t)(void * opaque, void * buf, size_t count);
typedef ssize_t (*fdwrite_t)(void * opaque, const void * buf, size_t count);
typedef off_t (*fdseek_t)(void * opaque, off_t offset, int whence);
typedef int (*fdclose_t)(void * opaque);
struct fddef_t {
fdread_t fdread;
/* main.c +185, enable to be compiled. */
#if 1
/* Create a task to record system log. */
xTaskCreate(system_logger,
(signed portCHAR *) "Logger",
1024 /* stack size */, NULL, tskIDLE_PRIORITY + 1, NULL);
#endif
/* main.c +126, create directory and file before open, avoid to fail. */
handle = host_action(SYS_SYSTEM, "mkdir -p output");
ROMDIR = $(DATDIR)/test-romfs
DAT += $(OUTDIR)/$(DATDIR)/test-romfs.o
$(OUTDIR)/$(ROMDIR).o: $(OUTDIR)/$(ROMDIR).bin
@mkdir -p $(dir $@)
@echo " OBJCOPY "$@
@$(CROSS_COMPILE)objcopy -I binary -O elf32-littlearm -B arm \
--prefix-sections '.romfs' $< $@
$(OUTDIR)/$(ROMDIR).bin: $(ROMDIR) $(OUTDIR)/$(TOOLDIR)/mkromfs
@mkdir -p $(dir $@)
@echo " MKROMFS "$@
// main.c +13
// define memory location of NVIC
#define NVIC_INTERRUPTx_PRIORITY ( ( volatile unsigned char *) 0xE000E400 )
// +317
int get_interrupt_priority(int interrupt)
{
if (interrupt < 240) // ARM 有 240 種 external interrupt(0~239) 和16種inernal interrupt
/* 根據 interrupt 設定 priority,這個常數宣告為 char*,故等同 array */
// workspace/visualizer/main.c
void trace_task_switch(void *prev_task, unsigned int prev_tick, void *curr_task)
{
char buf[128];
int len = snprintf(buf, 128, "switch %d %d %d %d %d %d\n",
prev_task, curr_task,
xTaskGetTickCount(), get_reload(),
prev_tick, get_current());
write(logfile, buf, len);
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <unistd.h>
#include<math.h>
#include<stdbool.h>
#include<pthread.h>
#include<sys/types.h>
int value = 1;
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<stdbool.h>
#include<unistd.h>
#include<sys/types.h>
void main()
{
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip3')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2362, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'pip3') not found
Error in sys.excepthook:
Traceback (most recent call last):