This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
struct ABC { | |
int index; | |
char name[6]; | |
int score; | |
} __attribute__((packed));; | |
struct DEF { | |
int att; | |
char name[3]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.syntax unified | |
.arch armv7-a | |
.text | |
.align 2 | |
.thumb | |
.thumb_func | |
.global fibonacci | |
.type fibonacci, function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.syntax unified | |
.arch armv7-a | |
.text | |
.align 2 | |
.thumb | |
.thumb_func | |
.global fibonacci | |
.type fibonacci, function |