Skip to content

Fixes implementation of __FlashStringHelper #183

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

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

arcao
Copy link
Contributor

@arcao arcao commented Feb 8, 2017

Previous __FlashStringHelper implementation was defines as a char which brought problem in case the method with char* parameter used overloading with __FlashStringHelper* parameter (they was identical). Now __FlashStringHelper is defined as a class and all casts between char* and __FlashStringHelper* are made with reinterpret_cast sugar.

Previous __FlashStringHelper implementation was defines as a char which brought problem in case the method with char* parameter used overloading with __FlashStringHelper* parameter (they was identical). Now __FlashStringHelper is defined as a class and all casts between char* and __FlashStringHelper* are made with reinterpret_cast sugar.
@arcao
Copy link
Contributor Author

arcao commented Feb 8, 2017

Please wait with merging... Thanks.

@arcao
Copy link
Contributor Author

arcao commented Feb 8, 2017

Test done.

Source:

void setup() {
  Serial.begin(115200);
  Serial.setDebugOutput(true);

  Serial.println("----------------------------");
  
  Serial.print(F("print\n"));

  Serial.println("----------------------------");

  Serial.println(F("println"));

  Serial.println("----------------------------");

  String var1 = F("F -> String\n");
  Serial.print(var1);

  Serial.println("----------------------------");

  var1 += F("String + F\n");
  Serial.print(var1);

  Serial.println("----------------------------");

  String var2 = String(F("String(F)\n"));
  Serial.print(var2);
}

void loop() {}

Result:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:1760
load:0x40078000,len:6668
load:0x40080000,len:252
entry 0x40080034
----------------------------
print
----------------------------
println
----------------------------
F -> String
----------------------------
F -> String
String + F
----------------------------
String(F)

@me-no-dev
Copy link
Member

awesome :)

@me-no-dev me-no-dev merged commit 67128fc into espressif:master Feb 8, 2017
@arcao arcao deleted the fix-flash-string-helper branch February 9, 2017 20:06
brentru pushed a commit to adafruit/arduino-esp32 that referenced this pull request Oct 22, 2024
darkxst pushed a commit to darkxst/arduino-esp32 that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants