docs: restructure framework, extract app execution module, group event collection & align GPIOs
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
## 2. 关键代码片段与逻辑实现
|
||||
|
||||
### 2.1 引脚控制宏与初始化
|
||||
马达由引脚 `P2.4` 控制。配置模式为推挽输出:
|
||||
马达由引脚 `P2.5` 控制。配置模式为推挽输出:
|
||||
```c
|
||||
sbit MOTOR = P2^4; // Pin 25
|
||||
sbit MOTOR = P2^5; // Pin 26
|
||||
|
||||
void Motor_Init(void) {
|
||||
// 将 P2.4 配置为推挽输出模式,默认输出低电平 0
|
||||
P2M1 &= ~(1 << 4);
|
||||
P2M0 |= (1 << 4);
|
||||
// 将 P2.5 配置为推挽输出模式,默认输出低电平 0
|
||||
P2M1 &= ~(1 << 5);
|
||||
P2M0 |= (1 << 5);
|
||||
MOTOR = 0;
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user