Skip to content

Commit

Permalink
added BDTR register and fixed systick time
Browse files Browse the repository at this point in the history
  • Loading branch information
fcayci committed Mar 28, 2017
1 parent 788b2c2 commit 4abc499
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions systick/systick.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ int32_t main(void)
GPIOD->ODR |= 0x0000; // 0x0002
GPIOE->ODR |= 0x4000;

// Initialize systick with 2**10 ~ 1Kil
// Initialize systick with 1000000
// Disable interrupt
init_systick(1 << 10, 0);
init_systick(1000000, 0);

while(1){
delay_ms(1000); // ~1 second
delay_ms(1000); // 1 second
GPIOE->ODR = GPIOE->ODR ^ 0x4000;
GPIOD->ODR = GPIOD->ODR ^ 0x0002;
}
Expand Down
2 changes: 1 addition & 1 deletion timer/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct
uint32_t CCR2; /* Address offset: 0x38 */
uint32_t CCR3; /* Address offset: 0x3C */
uint32_t CCR4; /* Address offset: 0x40 */
uint32_t RES2; /* Address offset: 0x44 */
uint32_t BDTR; /* Address offset: 0x44 */
uint32_t DCR; /* Address offset: 0x48 */
uint32_t DMAR; /* Address offset: 0x4C */
} TIM_type;
Expand Down
2 changes: 1 addition & 1 deletion timer_int/timer_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef struct
uint32_t CCR2; /* Address offset: 0x38 */
uint32_t CCR3; /* Address offset: 0x3C */
uint32_t CCR4; /* Address offset: 0x40 */
uint32_t RES2; /* Address offset: 0x44 */
uint32_t BDTR; /* Address offset: 0x44 */
uint32_t DCR; /* Address offset: 0x48 */
uint32_t DMAR; /* Address offset: 0x4C */
} TIM_type;
Expand Down

0 comments on commit 4abc499

Please sign in to comment.