- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 838
 
Closed
Description
[x ] PlatformIO Core
Configuration
Operating system: Windows 10
PlatformIO Version 3.6.5
Description of problem
I want to define URL, but I can't
Different variants:
src_build_flags = -D TEST_VAR=https://platformio.org  // result: https:
src_build_flags = -D TEST_VAR=https:\/\/platformio.org // https:
src_build_flags = -D TEST_VAR="https://platformio.org" // https:
src_build_flags = -D TEST_VAR=https:platformio.org // https:platformio.org
src_build_flags = -D TEST_VAR=https:/platformio.org // https:/platformio.org
src_build_flags = -D TEST_VAR="https:\/\/platformio.org" //warning: unknown escape sequence: '\/'
If problems with PlatformIO Build System:
The content of platformio.ini:
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
src_build_flags = -D TEST_VAR="https://platformio.org"
Source file to reproduce issue:
#include <Arduino.h>
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "="  VALUE(var)
void setup() {
    Serial.begin(9600);
    while(!Serial)
      ;
    
    #pragma message(VAR_NAME_VALUE(TEST_VAR))
    String key = VALUE(TEST_VAR);
    Serial.print(key);
}
void loop() {}
Metadata
Metadata
Assignees
Labels
No labels