另外我只要把我上传的第二张图的colz(col);col++;这两行代码去掉,系统也不会出现重启的问题,但colz这个函数只是给我设置的GPIO输出0和1的作用,为什么会影响到系统重启呢?[C] 纯文本查看 复制代码 void colz(uint8_t z)
{
switch(z)
{
case 0:
col0();
break;
case 1:
col1();
break;
case 2:
col2();
break;
case 3:
col3();
break;
case 4:
col4();
break;
case 5:
col5();
break;
case 6:
col6();
break;
case 7:
col7();
break;
case 8:
col8();
break;
case 9:
col9();
break;
case 10:
col10();
break;
}
}
void col1(void)
{
col1_1();
col2_0();
col3_0();
col4_0();
col5_0();
col6_0();
col7_0();
col8_0();
col9_0();
col10_0();
}
#define col1_1() GPIOA->BSRR = GPIO_PIN_0
#define col1_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_0 << 16U)
#define col2_1() GPIOA->BSRR = GPIO_PIN_1
#define col2_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_1 << 16U)
#define col3_1() GPIOA->BSRR = GPIO_PIN_2
#define col3_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_2 << 16U)
#define col4_1() GPIOA->BSRR = GPIO_PIN_3
#define col4_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_3 << 16U)
#define col5_1() GPIOA->BSRR = GPIO_PIN_4
#define col5_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_4 << 16U)
#define col6_1() GPIOA->BSRR = GPIO_PIN_5
#define col6_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_5 << 16U)
#define col7_1() GPIOA->BSRR = GPIO_PIN_6
#define col7_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_6 << 16U)
#define col8_1() GPIOA->BSRR = GPIO_PIN_7
#define col8_0() GPIOA->BSRR = ((uint32_t)GPIO_PIN_7 << 16U)
#define col9_1() GPIOC->BSRR = GPIO_PIN_4
#define col9_0() GPIOC->BSRR = ((uint32_t)GPIO_PIN_4 << 16U)
#define col10_1() GPIOC->BSRR = GPIO_PIN_5
#define col10_0() GPIOC->BSRR = ((uint32_t)GPIO_PIN_5 << 16U)
|