Skip to content

Commit

Permalink
Merge branch 'pull_req_185' into 'master'
Browse files Browse the repository at this point in the history
FG: Use explicit macro for MCU ports.

See merge request app-frameworks/esp_hosted!278
  • Loading branch information
mantriyogesh committed Jan 2, 2023
2 parents 21ff301 + d1ffca7 commit fe0b105
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions esp_hosted_fg/host/control_lib/src/ctrl_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <unistd.h>


#ifdef MCU
#ifdef MCU_SYS
#include "common.h"
#define command_log(...) printf(__VA_ARGS__); printf("\r");
#else
Expand All @@ -20,7 +20,7 @@
#define min(X, Y) (((X) < (Y)) ? (X) : (Y))
#endif

#ifndef MCU
#ifndef MCU_SYS
#define MAX_INTERFACE_LEN IFNAMSIZ
#define MAC_SIZE_BYTES 6
#define MIN_MAC_STR_LEN 17
Expand Down Expand Up @@ -160,7 +160,7 @@ static inline int is_ctrl_lib_state(int state)
}


#ifndef MCU
#ifndef MCU_SYS
/* Function converts mac string to byte stream */
static int convert_mac_to_bytes(uint8_t *out, size_t out_size, char *s)
{
Expand Down Expand Up @@ -1534,7 +1534,7 @@ int deinit_hosted_control_lib_internal(void)
int init_hosted_control_lib_internal(void)
{
int ret = SUCCESS;
#ifndef MCU
#ifndef MCU_SYS
if(getuid()) {
printf("Please re-run program with superuser access\n");
return FAILURE;
Expand Down Expand Up @@ -1582,7 +1582,7 @@ int init_hosted_control_lib_internal(void)



#ifndef MCU
#ifndef MCU_SYS

/* Function ups in given interface */
int interface_up(int sockfd, char* iface)
Expand Down
2 changes: 2 additions & 0 deletions esp_hosted_fg/host/stm32/port/include/platform_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <unistd.h>
#include <sys/types.h>

#define MCU_SYS 1

#define TIMEOUT_PSERIAL_RESP 30

#define CTRL__TIMER_ONESHOT 0
Expand Down
8 changes: 4 additions & 4 deletions esp_hosted_fg/host/stm32/proj/sdio/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1106515012" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.2015462317" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="MCU=1"/>
<listOptionValue builtIn="false" value="MCU_SYS=1"/>
<listOptionValue builtIn="false" value="STM32F412Zx"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.702662585" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
Expand Down Expand Up @@ -84,7 +84,7 @@
<listOptionValue builtIn="false" value="&quot;INPUT_STATION__SSID=${INPUT_STATION__SSID}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT_SOFTAP_BANDWIDTH=${INPUT_SOFTAP_BANDWIDTH}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT__OPERATING_MODE=${INPUT__OPERATING_MODE}&quot;"/>
<listOptionValue builtIn="false" value="MCU=1"/>
<listOptionValue builtIn="false" value="MCU_SYS=1"/>
<listOptionValue builtIn="false" value="STM32F412Zx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1792374213" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
Expand Down Expand Up @@ -180,7 +180,7 @@
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1113754967" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1321057505" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.860137312" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="MCU=1"/>
<listOptionValue builtIn="false" value="MCU_SYS=1"/>
<listOptionValue builtIn="false" value="STM32F412Zx"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.345452079" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
Expand Down Expand Up @@ -210,7 +210,7 @@
<listOptionValue builtIn="false" value="&quot;INPUT_STATION__SSID=${INPUT_STATION__SSID}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT_SOFTAP_BANDWIDTH=${INPUT_SOFTAP_BANDWIDTH}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT__OPERATING_MODE=${INPUT__OPERATING_MODE}&quot;"/>
<listOptionValue builtIn="false" value="MCU=1"/>
<listOptionValue builtIn="false" value="MCU_SYS=1"/>
<listOptionValue builtIn="false" value="STM32F407xx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1446818680" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
Expand Down
2 changes: 1 addition & 1 deletion esp_hosted_fg/host/stm32/proj/spi/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<listOptionValue builtIn="false" value="&quot;INPUT_SOFTAP_BANDWIDTH=${INPUT_SOFTAP_BANDWIDTH}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT__OPERATING_MODE=${INPUT__OPERATING_MODE}&quot;"/>
<listOptionValue builtIn="false" value="&quot;INPUT_GET_AP_SCAN_LIST=${INPUT_GET_AP_SCAN_LIST}&quot;"/>
<listOptionValue builtIn="false" value="MCU=1"/>
<listOptionValue builtIn="false" value="MCU_SYS=1"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.438442903" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../Core/Inc"/>
Expand Down
2 changes: 1 addition & 1 deletion esp_hosted_fg/host/virtual_serial_if/src/serial_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PROTO_PSER_TLV_T_EPNAME 0x01
#define PROTO_PSER_TLV_T_DATA 0x02

#ifdef MCU
#ifdef MCU_SYS
#define command_log(format, ...) printf(format "\r", ##__VA_ARGS__);
#else
#define command_log(...) printf("%s:%u ",__func__,__LINE__); \
Expand Down

0 comments on commit fe0b105

Please sign in to comment.