修复了结构体定义错误

This commit is contained in:
2022-05-13 11:41:00 +08:00
parent 6e42036f65
commit c9897ea0dd
7 changed files with 16 additions and 14 deletions

View File

@@ -43,7 +43,7 @@ lv_input_device_driver_t mouse_input;
**所有**函数采用驼峰命名法。 **所有**函数采用驼峰命名法。
```C ```C
int strLength(char* str); int StrLength(char* str);
``` ```
### 代码风格 ### 代码风格

View File

@@ -5,7 +5,7 @@
#include "rail.h" #include "rail.h"
#include "query.h" #include "query.h"
struct { struct bus {
/** /**
* 指向站点的指针 * 指向站点的指针
*/ */
@@ -14,7 +14,7 @@ struct {
* 当前行进的距离 * 当前行进的距离
*/ */
int distance; int distance;
} bus; };
/** /**
* 表示公交车的结构体 * 表示公交车的结构体

View File

@@ -11,11 +11,11 @@ enum read_state{
/** /**
* 时钟 * 时钟
*/ */
clock = 0, io_clock = 0,
/** /**
* 读取中 * 读取中
*/ */
reading, io_reading,
/** /**
* 结束 * 结束
*/ */

View File

@@ -4,9 +4,10 @@
#ifndef AUTO_PILOT_BUS_QUERY_H #ifndef AUTO_PILOT_BUS_QUERY_H
#define AUTO_PILOT_BUS_QUERY_H #define AUTO_PILOT_BUS_QUERY_H
#include "stdlib.h"
#include "rail.h" #include "rail.h"
struct { struct up_bus {
/** /**
* 请求的序号 * 请求的序号
*/ */
@@ -20,9 +21,9 @@ struct {
*/ */
rail_node_t* target; rail_node_t* target;
struct up_bus* next; struct up_bus* next;
} up_bus; };
struct { struct down_bus {
/** /**
* 请求的序号 * 请求的序号
*/ */
@@ -32,7 +33,7 @@ struct {
*/ */
rail_node_t* target; rail_node_t* target;
struct down_bus* next; struct down_bus* next;
} down_bus; };
/** /**
* 表示上车请求的结构体 * 表示上车请求的结构体

View File

@@ -1,7 +1,8 @@
#ifndef AUTO_PILOT_BUS_RAIL_H #ifndef AUTO_PILOT_BUS_RAIL_H
#define AUTO_PILOT_BUS_RAIL_H #define AUTO_PILOT_BUS_RAIL_H
#include "stdlib.h"
struct { struct rail_node {
/** /**
* 站点的编号 * 站点的编号
*/ */
@@ -22,7 +23,7 @@ struct {
* 指向下一个站点的指针 * 指向下一个站点的指针
*/ */
struct rail_node* next_node; struct rail_node* next_node;
} rail_node; };
/** /**
* 表示轨道上的一个站点的结构体 * 表示轨道上的一个站点的结构体

View File

@@ -3,6 +3,6 @@
// //
#include "query.h" #include "query.h"
up_bus_t* up_queries; up_bus_t* up_queries = NULL;
down_bus_t *down_queries; down_bus_t *down_queries = NULL;

View File

@@ -1,6 +1,6 @@
#include "rail.h" #include "rail.h"
rail_node_t *rails; rail_node_t *rails = NULL;
int add(int a, int b) int add(int a, int b)
{ {