自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(48)
  • 问答 (1)
  • 收藏
  • 关注

原创 windows vs2005编译libssh2支持sftp

​ 需要用到4个库:libcurl、libssh2、openssl、zlib。

2024-01-25 08:29:15 926

原创 arm-linux设备fsck命令移植

这里我下载1.45.0的版本。

2023-12-11 13:53:08 199

原创 uboot升级内核与文件系统方法

1、擦除原内核并写入新内核U-Boot> sf erase 200000 500000U-Boot> tftp 22000000 zImagephy_id1: 0x001cmacb0: PHY present at 3macb0: link up, 100Mbps full-duplex (lpa: 0xc5e1)Using macb0 deviceTFTP from server 10.72.71.52; our IP address is 10.72.71.199Filena

2020-10-26 09:44:03 1485 2

原创 W: Failed to fetch http://ubuntu.cn99.com/ubuntu/dists/precise/multiverse/i18n/Index 错误解决方法

sudo apt-get updatehi~ 小伙伴们,如果大家sudo apt-get update 遇到一大片这类错误,W: Failed to fetch http://ubuntu.cn99.com/ubuntu/dists/precise-updates/InRelease W: Failed to fetch http://ubuntu.cn99.com/ubuntu/dists/precise-security/InRelease W: Failed to fetch htt

2020-09-19 09:16:33 2173

原创 Linux编程日常记录

access()用法:#include <unistd.h>int access(const char * pathname.int mode);pathname:路径名+文件名modeF_OK 值为0,判断文件是否存在X_OK 值为1,判断对文件是可执行权限W_OK 值为2,判断对文件是否有写权限R_OK 值为4,判断对文件是否有读权限注:后三种可以使用或“|”的方式,一起使用,如W_OK|R_OK...

2020-09-15 21:53:55 106

原创 Linux串口编程最全详解-一个努力奋斗的少年

NAMEtermios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed - 获取和设置终端属性,行控制,获取和设置波特率SYNOPSIS 总览#include <termios.h> #include <unistd.h>int tcgetattr(int fd, struc

2020-09-15 21:39:32 1889 1

原创 Ubuntu配置

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.

2020-09-02 18:40:09 90

原创 windows10家庭版组策略

**加入策略.cmd**@echo offpushd "%~dp0"dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txtdir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>Lis

2020-07-28 19:30:03 203

原创 解决Sublime Text3 Install Package时出现there are no package available for installtion

1、在使用sublime下载扩展包的过程中,通过ctrl+shift+p打开包管理菜单界面,输入install 选中Install Package并回车,出现There are no packages available for installation的提示,导致安装插件出现问题2、分析原因发现,在利用sublime进行插件下载时,sublime会调用channel_v3.json文件,点击...

2020-04-08 18:59:05 609

原创 UART、SPI、IIC区别详解

2020-04-02 11:23:24 461

原创 linux UART串口开发完整代码

#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <stdlib.h> #include <unistd.h> ...

2020-02-08 16:22:56 399

原创 关于CRH、CRL、ODR和IDR寄存器的使用总结

一.CRH和CRL的使用:CRH和CRL的使用基本相同,CRH用于控制GPIOX(X表示A—G)的高8位(Pin15—Pin8),而CRL用于控制GPIOX(X表示A—G)的低8位(Pin7----Pin0)。二.ODR的使用:RCC->APB2ENR|=1<<2; //使能PORTA时钟 GPIOA->CRH&=0XFFFFFFF0;/...

2020-01-28 17:46:25 4751

原创 linux视频驱动接口V4L2视频采集程序完整版

继平台驱动模型之后的V4L2,现在贴上完整注释版的源码我已经在三星exynos4412处理器上跑过,亲测无误此文的注释我已经写的非常详细,要是有问题,欢迎留言哈~~~,希望对看到的你有所帮助~~话不多说,直接上代码/* * 文件名:cameral.c * 文件描述:linux视频驱动接口V4L2视频采集 * 编写人:兰永祥 * 编写日期:2019-11-10 */#inclu...

2019-11-10 22:44:15 547

原创 基于 Linux 视频驱动接口 V4L2 视频采集程序

亲测:我已经在三星exynos4412处理器上跑过一遍,程序的注释我也写的很全,希望对看到的人有用哈~~看不懂的可以留言哦[email protected] 附带我的邮箱/* Framebuffer & V4L2 video capture example * * This program can be used and distributed without restricti...

2019-11-09 16:25:05 230

原创 Linux平台驱动模型

1、platform_devicestruct platform_device { const char * name;//设备名称 u32 id;//取-1 struct device dev;//设备结构 u32 num_resources;// resource结构个数 struct resource * re...

2019-10-28 08:56:50 99

原创 用递归法将整数转换成字符串

void convert(int n, char str[]){ static int j = 0; if (n < 0) { str[j++] = '-'; n = -n; } if ((n/10) != 0) { convert(n/10, str); } str[j++] = n % 10 + '0';}int main(){ char st...

2019-10-07 13:10:53 1807 1

原创 求2~2000的所有素数,有足够的内存,要求尽量快

bool Issu(int Number){ if (Number == 2 || Number == 3) { return true; } for (int i = 2; i < sqrt(Number); i++) { if (Number % i == 0) { return false; } } return true;}void pri...

2019-10-07 11:34:48 374

原创 螺旋矩阵

void matrix(){ const int n = 5; int count = 1; int i = 0; int arr[n][n]; for (i = 0; i < n / 2 + 1; i++) { /*先是遍历一行*/ for (int j = i; j <= n - i - 1; j++) { arr[i][j] = count++;...

2019-10-06 13:21:23 76

原创 Linux制作SD卡启动

第一步dd iflag=dsync oflag=dsync if=/dev/zero of=uboot.img bs=516k count=1if:输入文件of:输出文件bs: 读取输入文件/写入输出文件,每次读取/写入的数据大小count:执行几次读写操作。第二步dd iflag=dsync oflag=dsync if=u-boot-fs4412.bin of=uboot.im...

2019-09-28 16:58:31 1209

原创 嵌入式面试题总结

SPI总线串行外围设备接口,是一种高速的、全双工、同步的通信总线。只占用四根线,(省线)

2019-09-23 20:13:30 434

原创 ARM知识点总结

day1soc ------ 片上系统计算机系统的硬件组成:1, 输入设备: 键盘,鼠标,2, 输出设备: 显示器, 打印机,3, 存贮设备: 硬盘(保存文件,保存数据), 光盘, 内存(程序运行), u盘4, 运算器: alu5, 控制器: controller6, 总线: apb(硬件接口总线), ahb (高速总线), dma(直接内存存取)使用dma总线:设置...

2019-09-19 12:32:22 1168

原创 linux进程知识点总结

day11、标准IO的介绍2、缓冲区3、相关函数1、标准IO的介绍标准IO:标准C库提供的一系列用来进行输入和输出的函数输入:将数据从文件拷贝到内存(标准输入(scanf):从键盘将数据拷贝到内存)输出:将数据从内存拷贝到文件(标准输出(printf):将数据从内存拷贝到终端)FILE结构体: 每个被使用的文件都在内存中开辟一个区域,用来存放文件的有关信息,这些信息是保存在一...

2019-09-18 13:00:18 329

原创 插入排序

void InsertSort(int* arr,int n){ int i, j; int tmp = 0; for (i = 1; i < n; i++) { tmp = arr[i]; j = i - 1; while (tmp < arr[j] && j >=0 ) { arr[j + 1] = arr[j]; j--...

2019-09-12 19:07:11 62

原创 二进制转换和判断是否为2的二次冥

1、二进制转换int exchan_bin(int num) { int i = 0; for(i = 7;i >= 0;i--) { if(num & (0x1 << i)) { printf("1"); }...

2019-09-11 19:36:45 314

原创 c++ STL

1、vector容器vector 整型数组/*vector 整型数组*/vector<int> vn; /*创建vector容器*/for (int i = 0; i < 10; i++){ vn.push_back(i); //将数据存入}for (int i = 0; i < 10; i++){ cout << vn[i] &l...

2019-09-06 19:18:23 81

原创 C++二义性问题

1、多重继承时的二义性问题class A{ //类A的定义public: void print () {cout<<"Hello, this is A"<<endl;}};class B{ //类B的定义public: void print () {cout<<"Hello, this is B"<<endl;}};class ...

2019-09-05 20:52:15 505

原创 C++智能指针深度理解

1、auto_ptr (不要使用的指针)没有智能指针的c++时代,对堆内存的管理就是简单的new delete。但是缺点是容易忘了delete释放,即使是资深码农,也可能会在某一个地方忘记delete它,造成内存泄漏。在实际工程中,我们往往更希望把精力放在应用层上,而不是费尽心思在语言的细枝末节(内存的释放)。于是就有了这个最原始的智能指针。template<typename T&...

2019-09-05 19:57:55 258

原创 C++知识点总结

一、 day1一,C++课程内容:1,从C迁移到C++ (C和C++的联系和区别)2,C++中的结构体与类3,深入理解C++语言中类的设计4,C++中的继承5,C++中的多态6,C++中的运算符重载7,C++模板8,C++中的输入输出流 9,C++智能指针,C++中的异常处理。10,STL(标准模板库)C++三大特性:封装,继承,多态二,什么是C++?1,什么是C++...

2019-09-04 12:36:31 270

原创 进程与线程间通信函数总结

1.创建进程#include <sys/types.h>#include <unistd.h>pid_t pid = fork();if(pid < 0){ perror("frok error."); return -1;}else if(pid == 0) { /*子进程*/ }else { /*父进程*/ }getpid()获得当前进...

2019-08-17 13:10:40 129

原创 Linux 进程间通信

1、有名管道/*无名管道双向通信试验*/#include <stdio.h>#include <unistd.h>#include <fcntl.h>int main(int argc,char *argv[]){ int fd_fs[2],fd_sf[2]; if(pipe(fd_fs) || pipe(fd_sf)) /*创建管道...

2019-08-16 17:47:30 79

原创 linux C函数库详解

http://net.pku.edu.cn/~yhf/linux_c/

2019-08-16 08:57:46 274

原创 守护进程

/*守护进程*/#include<stdio.h>#include <sys/types.h>#include <stdlib.h>#include <unistd.h>#include <sys/stat.h>#include <fcntl.h>#include <syslog.h>int mai...

2019-08-15 23:02:20 94

原创 线程创建、信号量、互斥锁函数

创建进程#include <pthread.h>int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);功能:在进程中创建子线程(原来的进程可以称为主线程)参数:thread–...

2019-08-15 23:00:40 276

原创 静态库与动态库

静态库静态库是在编译阶段,就链接到目标代码中,生成的文件体积较大,但是可移植性好。创建静态库用 ar 命令,它将很多的 .o 转换成 .aar ars libmyhello.a hello.o/*使用静态库*/gcc -o hello main.c -L./ -lmyhello动态库动态库是在运行阶段,链接到目标代码中,生成的文件体积较小,但是如果移植,需要将库一起移植。gcc ...

2019-08-13 17:10:16 46

原创 单链表增删改查,排序(结点交换)->敲黑板划重点

敲黑板划重点头文件 myll.h /************************************************************************* > File Name: myll.h > Author:lanyxs > Mail:[email protected] > Created Time: Thu 08 Aug 201...

2019-08-10 14:33:06 117

原创 顺序表-简单的学生管理系统

#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAX_SIZE 4/*定义顺序表元素:结构体*/typedef struct student{char name[20];int height;int weight;}STU;/*定义顺序表*/typedef...

2019-08-09 12:45:36 264

原创 单链表的增删改查

#include <stdio.h>#include <string.h>#include <stdlib.h>typedef int DATA_T;typedef struct node /*定义结点*/{ DATA_T data; struct node *pNext;}NODE;typedef struct list ...

2019-08-09 12:41:48 97

原创 .vimrc

sudo apt-get install gitgit clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vimvim /root/.vimrc或者 vim ~/.vimrcset nocompatiblefiletype on set rtp+=~/.vim/bundle/Vundle....

2019-08-02 13:47:04 162

原创 xshell 官网下载

xhell6下载地址https://www.netsarang.com/zh/xshell/

2019-08-01 19:51:51 969

原创 函数指针数组

(1) 定义一个指向数组的指针,该数组的类型是长度为5的int数组eg: int (* pbr) [5];(2) 定义一个指向函数的指针普通函数: float add(float a,float b);------->float (float ,float )函数的指针: float (* pfun)(float,float); -------> floa...

2019-07-31 14:53:58 450

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除