mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Merge pull request #387 from QuangNguyenMinh123/#381_Add_recursive,stm32,Rpi4_test_case
Update recursive test
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
DEVICE:=
|
||||
|
||||
default:
|
||||
/bin/bash build_Rpi4_owrt.sh
|
||||
|
||||
install_docker:
|
||||
bash install_docker.sh
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Debugging hardware will be more laborious than debugging PC application.
|
||||
# Build Rpi4 image
|
||||
+ `make build_docker` to build docker
|
||||
+ `make docker` to enter docker container
|
||||
+ `./build_Rpi4_owrt.sh` inside docker to automatically build image for Rpi4. Wait for 1 or 2 hours, depends on your internet speed and PC specs
|
||||
+ `make` inside docker to automatically build image for Rpi4. Wait for 1 or 2 hours, depends on your internet speed and PC specs
|
||||
+ Final image will be: openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
|
||||
# Flash image to your microSD card
|
||||
Please read this carefully before deployment
|
||||
|
||||
@@ -16,7 +16,8 @@ git config --global http.maxRequestBuffer 100M
|
||||
git config --global http.version HTTP/1.1
|
||||
git config --global http.maxRequests 100
|
||||
git config --global core.compression 0
|
||||
|
||||
git config --global --unset http.proxy
|
||||
git config --global --unset https.proxy
|
||||
# Define variables
|
||||
TOPDIR=$PWD
|
||||
OPENWRT_DIR="$PWD/openwrt"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
################################################################################
|
||||
# Bootloader configuration - config.txt
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# For overclocking and various other settings, see:
|
||||
# https://www.raspberrypi.com/documentation/computers/config_txt.html
|
||||
################################################################################
|
||||
|
||||
# OpenWrt config
|
||||
include distroconfig.txt
|
||||
|
||||
[all]
|
||||
# Place your custom settings here.
|
||||
[all]
|
||||
enable_jtag_gpio=1
|
||||
gpio=22-27=a4
|
||||
|
||||
[pi1]
|
||||
gpio=4=a5
|
||||
|
||||
[pi2]
|
||||
gpio=4=a5
|
||||
|
||||
[pi3]
|
||||
gpio=4=a5
|
||||
@@ -5,17 +5,27 @@
|
||||
#include <chrono>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct childStruct
|
||||
{
|
||||
int childId;
|
||||
std::string childString;
|
||||
int age;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
struct structTetst
|
||||
struct parentStruct
|
||||
{
|
||||
int id;
|
||||
std::string b;
|
||||
childStruct child;
|
||||
int age;
|
||||
std::string name;
|
||||
childStruct childArr[100];
|
||||
};
|
||||
|
||||
struct familyStruct
|
||||
{
|
||||
parentStruct dad;
|
||||
int numberOfNumber;
|
||||
char familyName[50];
|
||||
parentStruct mom;
|
||||
};
|
||||
|
||||
int factorial(int n);
|
||||
|
||||
@@ -46,15 +46,47 @@
|
||||
*
|
||||
*/
|
||||
int factorial(int n) {
|
||||
struct structTetst testStruct = {-2, "test", {-1, "childTest"}};
|
||||
testStruct.id ++;
|
||||
testStruct.id ++;
|
||||
testStruct.id ++;
|
||||
struct familyStruct family = {
|
||||
// DAD
|
||||
{
|
||||
50,
|
||||
"DAD_NAME",
|
||||
{
|
||||
{1,
|
||||
"1st_child"},
|
||||
{2,
|
||||
"2nd_child"},
|
||||
{3,
|
||||
"3rd_child"},
|
||||
}
|
||||
},
|
||||
4, "FAMILY",
|
||||
|
||||
// MOM
|
||||
{
|
||||
45,
|
||||
"MOM_NAME",
|
||||
{
|
||||
{'a',
|
||||
"a_child"},
|
||||
{'b',
|
||||
"b_child"},
|
||||
{'c',
|
||||
"c_child"},
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
family.numberOfNumber ++;
|
||||
family.numberOfNumber ++;
|
||||
family.numberOfNumber ++;
|
||||
int abc = 0;
|
||||
abc ++;
|
||||
abc *= 2;
|
||||
testStruct.child.childId ++;
|
||||
testStruct.child.childString = "childTest " + std::to_string(abc);
|
||||
family.dad.childArr[0].age ++;
|
||||
family.dad.childArr[1].name = "childTest " + std::to_string(abc);
|
||||
family.mom.childArr[1].age ++;
|
||||
family.mom.childArr[0].name = "childTest " + std::to_string(abc) + std::to_string(abc);
|
||||
if (n <= 1) return 1;
|
||||
return n * factorial(n - 1);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,36 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
struct structTetst globalStruct = {-2, "test", {-1, "childTest"}};
|
||||
struct familyStruct globalStruct = {
|
||||
// DAD
|
||||
{
|
||||
50,
|
||||
"DAD_NAME",
|
||||
{
|
||||
{1,
|
||||
"1st_child"},
|
||||
{2,
|
||||
"2nd_child"},
|
||||
{3,
|
||||
"3rd_child"},
|
||||
}
|
||||
},
|
||||
4, "FAMILY",
|
||||
// MOM
|
||||
{
|
||||
45,
|
||||
"MOM_NAME",
|
||||
{
|
||||
{'a',
|
||||
"a_child"},
|
||||
{'b',
|
||||
"b_child"},
|
||||
{'c',
|
||||
"c_child"},
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
/***
|
||||
*
|
||||
*
|
||||
@@ -55,15 +84,15 @@ struct structTetst globalStruct = {-2, "test", {-1, "childTest"}};
|
||||
*
|
||||
*/
|
||||
int main() {
|
||||
globalStruct.id =0;
|
||||
globalStruct.numberOfNumber =0;
|
||||
int a = 10, b = 3;
|
||||
pid_t pid = getpid();
|
||||
std::cout << "Process ID: " << pid << std::endl;
|
||||
while (globalStruct.id < 100)
|
||||
while (globalStruct.numberOfNumber < 100)
|
||||
{
|
||||
globalStruct.id++;
|
||||
globalStruct.child.childId = globalStruct.id;
|
||||
globalStruct.child.childString = "Child String " + std::to_string(globalStruct.id);
|
||||
globalStruct.numberOfNumber++;
|
||||
globalStruct.dad.age = globalStruct.numberOfNumber;
|
||||
globalStruct.dad.name = "Dad String " + std::to_string(globalStruct.numberOfNumber);
|
||||
cout << "Basic Arithmetic:" << endl;
|
||||
cout << a << " + " << b << " = " << add(a, b) << endl;
|
||||
cout << a << " - " << b << " = " << subtract(a, b) << endl;
|
||||
@@ -73,7 +102,7 @@ int main() {
|
||||
cout << "\nAdvanced Math:" << endl;
|
||||
cout << "Factorial of 5 = " << factorial(5) << endl;
|
||||
cout << "Fibonacci of 7 = " << fibonacci(7) << endl;
|
||||
globalStruct.child.childId ++;
|
||||
globalStruct.dad.age ++;
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user