代码拉取完成,页面将自动刷新
同步操作将从 uqifgjij/ymodem-1 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "Ymodem.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
extern FILE *pFile;
void uart_start(){
pFile = fopen ( "/dev/ttyPS0" , "r+") ;
}
void uart_end(){
fclose(pFile);
printf("uart close right!\n");
}
char __getchar(){
char ch = '0';
// fread(&ch, sizeof(char), sizeof(char) , pFile );
fgetc(pFile);
//printf("%c ", ch);
return ch;
}
void __getbuf(char* buf, size_t len){
//fread(buf, sizeof(char), len, pFile );
//len = read(pFile,buf, len);
len = fread(buf, sizeof(char), len , pFile );
printf("getbuf: len=%d\n", len);
}
void __putchar( char ch ){
char ch1 = ch;
int len =0;
len = fread(&ch1, sizeof(char), sizeof(char) , pFile );;
printf("putchar: len = %d\n", len);
}
void __putbuf( char* buf, size_t len ){
}
// #include "Ymodem.h"
// #include <sys/types.h>
// #include <sys/stat.h>
// #include <fcntl.h>
//
// extern int pFile;
//
//
//
// void uart_start(){
// pFile = open ( "/dev/ttyPS0" , O_RDWR) ;
//
// }
//
// void uart_end(){
// close(pFile);
// printf("uart close right!\n");
//
// }
//
//
//
// char __getchar(){
// char ch = '0';
// read(pFile, &ch, sizeof(char));
// flush;
// sync;
// //printf("%c ", ch);
// return ch;
// }
//
// void __getbuf(char* buf, size_t len){
// //fread(buf, sizeof(char), len, pFile );
// //len = read(pFile,buf, len);
// int i = 0;
// for(i = 0; i < len; i++){
// //printf("%d:", i);
// buf[i] = __getchar();
// }
// //printf("getbuf: len=%d\n", len);
// }
//
//
// void __putchar( char ch ){
// char ch1 = ch;
// int len =0;
// len = write(pFile, &ch1, sizeof(char));
// //write(&ch1, sizeof(char), sizeof(char) , pFile );
// printf("putchar: len = %d\n", len);
// }
//
//
// void __putbuf( char* buf, size_t len ){
//
// }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。