Skip to content

Instantly share code, notes, and snippets.

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 */,
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
void vTaskStartScheduler( void )
{
portBASE_TYPE xReturn;
/* Add the idle task at the lowest priority. */
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
{
/* Create the idle task, storing its handle in xIdleTaskHandle so it can
be returned by the xTaskGetIdleTaskHandle() function. */
xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle );
void fibo_command(int n, char *argv[]) {
int i = 0;
int first = 0;
int second = 1;
int result;
fio_printf(1, "\r\n");
if(n == 1) {
fio_printf(1, "Please assign a number \r\n");
#include<stdio.h>
struct ABC {
int index;
char name[6];
int score;
} __attribute__((packed));;
struct DEF {
int att;
char name[3];
cd ~/workspace
git clone git@github.com:embedded2015/freertos-basic.git
# 或者: git clone https://github.com/embedded2015/freertos-basic.git
cd freertos-basic
make
make qemu
輸入 “help” 可見已實作的 shell command
ps
mmtest
mkdir -p workspace
cd workspace
git clone git://github.com/beckus/stm32_p103_demos.git || git clone https://github.com/beckus/stm32_p103_demos.git
git clone git://github.com/beckus/qemu_stm32.git || git clone https://github.com/beckus/qemu_stm32.git
cd qemu_stm32
git submodule update --init dtc || sudo apt-get install libfdt-dev
./configure --disable-werror --enable-debug \
--target-list="arm-softmmu" \
--extra-cflags=-DSTM32_UART_NO_BAUD_DELAY \
#define MKCL(n, d) {.name=#n, .fptr=n ## _command, .desc=d}
cmdlist cl[]={
MKCL(ls, "List directory"),
MKCL(man, "Show the manual of the command"),
MKCL(cat, "Concatenate files and print on the stdout"),
.syntax unified
.arch armv7-a
.text
.align 2
.thumb
.thumb_func
.global fibonacci
.type fibonacci, function
.syntax unified
.arch armv7-a
.text
.align 2
.thumb
.thumb_func
.global fibonacci
.type fibonacci, function