-
Notifications
You must be signed in to change notification settings - Fork 909
Untangle config dependencies, misc prefactors #2180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #pragma once | ||
| typedef struct { | ||
| uint8_t request; | ||
| uint16_t param1; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| #include "fan_declarations.h" | ||
| #include "utils.h" | ||
|
|
||
| struct fan_state_t fan_state; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #pragma once | ||
| #include "faults_declarations.h" | ||
|
|
||
| uint8_t fault_status = FAULT_STATUS_NONE; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // **** libc **** | ||
| #pragma once | ||
|
|
||
| void delay(uint32_t a) { | ||
| volatile uint32_t i; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
board/bootstub_declarations.h → include/board/bootstub_definitions.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #pragma once | ||
| #include <stdbool.h> | ||
| #include "platform_definitions.h" | ||
|
|
||
| #define MODE_INPUT 0 | ||
| #define MODE_OUTPUT 1 | ||
| #define MODE_ALTERNATE 2 | ||
| #define MODE_ANALOG 3 | ||
|
|
||
| #define PULL_NONE 0 | ||
| #define PULL_UP 1 | ||
| #define PULL_DOWN 2 | ||
|
|
||
| #define OUTPUT_TYPE_PUSH_PULL 0U | ||
| #define OUTPUT_TYPE_OPEN_DRAIN 1U | ||
|
|
||
| typedef struct { | ||
| GPIO_TypeDef * const bank; | ||
| uint8_t pin; | ||
| } gpio_t; | ||
|
|
||
| void set_gpio_mode(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); | ||
| void set_gpio_output(GPIO_TypeDef *GPIO, unsigned int pin, bool enabled); | ||
| void set_gpio_output_type(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int output_type); | ||
| void set_gpio_alternate(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); | ||
| void set_gpio_pullup(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); | ||
| int get_gpio_input(const GPIO_TypeDef *GPIO, unsigned int pin); | ||
| void gpio_set_all_output(gpio_t *pins, uint8_t num_pins, bool enabled); | ||
| void gpio_set_bitmask(gpio_t *pins, uint8_t num_pins, uint32_t bitmask); | ||
| bool detect_with_pull(GPIO_TypeDef *GPIO, int pin, int mode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #pragma once | ||
| #include "main_declarations.h" | ||
|
|
||
| // ********************* Globals ********************** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* Platform includes that provide definitions that a lot drivers need, e.g.: | ||
| __enable_irq | ||
| __disable_irq | ||
| GPIO_TypeDef | ||
| TIM_TypeDef | ||
| IRQn_Type | ||
| USART_TypeDef | ||
| CAN_TypeDef | ||
| */ | ||
| #pragma once | ||
| #ifdef STM32H7 | ||
| #include "stm32h7/stm32h7_platform_definitions.h" | ||
| #elif defined(STM32F4) | ||
| #include "stm32f4/stm32f4_platform_definitions.h" | ||
| #endif |
35 changes: 0 additions & 35 deletions
35
board/stm32f4/stm32f4_config.h → include/board/stm32f4/stm32f4_config.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #pragma once | ||
| #include "stm32f4/inc/stm32f4xx.h" | ||
| #include "stm32f4/inc/stm32f4xx_hal_gpio_ex.h" | ||
| #define MCU_IDCODE 0x463U | ||
|
|
||
| #define CORE_FREQ 96U // in MHz | ||
| #define APB1_FREQ (CORE_FREQ / 2U) | ||
| #define APB1_TIMER_FREQ \ | ||
| (APB1_FREQ * 2U) // APB1 is multiplied by 2 for the timer peripherals | ||
| #define APB2_FREQ (CORE_FREQ / 2U) | ||
| #define APB2_TIMER_FREQ \ | ||
| (APB2_FREQ * 2U) // APB2 is multiplied by 2 for the timer peripherals | ||
|
|
||
| #define BOOTLOADER_ADDRESS 0x1FFF0004U | ||
|
|
||
| // Around (1Mbps / 8 bits/byte / 12 bytes per message) | ||
| #define CAN_INTERRUPT_RATE 12000U | ||
|
|
||
| #define MAX_LED_FADE 8192U | ||
|
|
||
| #define NUM_INTERRUPTS \ | ||
| 102U // There are 102 external interrupt sources (see stm32f413.h) | ||
|
|
||
| #define TICK_TIMER_IRQ TIM1_BRK_TIM9_IRQn | ||
| #define TICK_TIMER TIM9 | ||
|
|
||
| #define MICROSECOND_TIMER TIM2 | ||
|
|
||
| #define INTERRUPT_TIMER_IRQ TIM6_DAC_IRQn | ||
| #define INTERRUPT_TIMER TIM6 | ||
|
|
||
| #define IND_WDG IWDG | ||
|
|
||
| #define PROVISION_CHUNK_ADDRESS 0x1FFF79E0U | ||
| #define DEVICE_SERIAL_NUMBER_ADDRESS 0x1FFF79C0U |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try not to suppress any misra errors like these, let's fix them instead