Skip to content

Commit

Permalink
Merge branch 'bugfix/allow_including_ports_from_cpp' into 'master'
Browse files Browse the repository at this point in the history
Allow including port headers from C++

Closes ESF-2

See merge request espressif/esp-serial-flasher!48
  • Loading branch information
dobairoland committed Jan 23, 2023
2 parents a61f744 + 0fcbdca commit 8559893
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
10 changes: 9 additions & 1 deletion port/esp32_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
uint32_t baud_rate; /*!< Initial baud rate, can be changed later */
Expand Down Expand Up @@ -48,4 +52,8 @@ esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config);
/**
* @brief Deinitialize serial interface.
*/
void loader_port_esp32_deinit(void);
void loader_port_esp32_deinit(void);

#ifdef __cplusplus
}
#endif
10 changes: 9 additions & 1 deletion port/raspberry_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@
#include <stdint.h>
#include "serial_io.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
const char *device;
uint32_t baudrate;
uint32_t reset_trigger_pin;
uint32_t gpio0_trigger_pin;
} loader_raspberry_config_t;

esp_loader_error_t loader_port_raspberry_init(const loader_raspberry_config_t *config);
esp_loader_error_t loader_port_raspberry_init(const loader_raspberry_config_t *config);

#ifdef __cplusplus
}
#endif
10 changes: 9 additions & 1 deletion port/stm32_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "serial_io.h"
#include "stm32f4xx_hal.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
UART_HandleTypeDef *huart;
GPIO_TypeDef *port_io0;
Expand All @@ -27,4 +31,8 @@ typedef struct {
uint16_t pin_num_rst;
} loader_stm32_config_t;

void loader_port_stm32_init(loader_stm32_config_t *config);
void loader_port_stm32_init(loader_stm32_config_t *config);

#ifdef __cplusplus
}
#endif

0 comments on commit 8559893

Please sign in to comment.