Skip to content

Commit f519ecd

Browse files
committed
Cleanup some gpio
1 parent 41ed5cd commit f519ecd

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

examples/debugprintfdemo/debugprintfdemo.c

+9-11
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,23 @@ int main()
2222
// Enable GPIOs
2323
RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC;
2424

25-
// GPIO D0 Push-Pull
26-
GPIOD->CFGLR &= ~(0xf<<(4*0));
27-
GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0);
28-
29-
// GPIO C0 Push-Pull
30-
GPIOC->CFGLR &= ~(0xf<<(4*0));
31-
GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0);
25+
funPinMode( PD0, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP );
26+
funPinMode( PC0, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP );
3227

3328
while(1)
3429
{
35-
GPIOD->BSHR = 1; // Turn on GPIOs
36-
GPIOC->BSHR = 1;
30+
funDigitalWrite( PD0, 1 );
31+
funDigitalWrite( PC0, 1 );
32+
3733
printf( "+%lu\n", count++ );
3834
Delay_Ms(100);
3935
int i;
4036
for( i = 0; i < 10000; i++ )
4137
poll_input();
42-
GPIOD->BSHR = (1<<16); // Turn off GPIODs
43-
GPIOC->BSHR = (1<<16);
38+
39+
funDigitalWrite( PD0, 0 );
40+
funDigitalWrite( PC0, 0 );
41+
4442
printf( "-%lu[%c]\n", count++, last );
4543
Delay_Ms(100);
4644
}

0 commit comments

Comments
 (0)