Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Sam Kendrick
@adnauseum
@everslick What is "SI"? Also, removing the Serial.prints was what I needed to do; my project doesn't need to wait for the lambda function's response anyways.
@adnauseum
Michael Miller
@Makuna
@igrr I have a consumer of my NeoPixel library that is running into an issue when they use the new feature to put the VTable into flash. My library doesn't have any virtual functions and thus the VTable is not really the issue; but what I think the problem is around that I store a pointer to the class in static member that the DMA ISR uses to access buffer pointers. Is there a need for any specific qualifiers on such a static.
static NeoEsp8266DmaMethodBase* s_this; // for the ISR
The problem is not present if they leave the VTable in the default location.
nardev
@nardev
hey guys is this even possible??? esp8266/Arduino#4635 TO change SPI predefined pins?
AlfonsMittelmeyer
@AlfonsMittelmeyer
@devyte it's the first time, that I visit gitter. Yes now the time is fitting, to discuss the shared timers for ESP8266 and especially pwm.
Develo
@devyte
@AlfonsMittelmeyer welcome to our public channel
Earle F. Philhower, III
@earlephilhower
@Makuna have him open an issue on the Arduino-8266 tracker with a stack decode. Class static variables sit in BSS, which is always in RAM. There is also a .MAP file generated on ARduino compile where you can find the absolute address of this variable (post-C++-name-mangling) to verify its location. Only symbols starting with _ZTV (a prefix that GCC adds only to vtable names) should be moved.
Michael Miller
@Makuna
Thanks @earlephilhower , I have been trying to create a minimum sketch that demonstrates it. I am seeing some interesting behavior when the class object is destroyed, the static variable values (I added some debug static variables to track some stuff) are being changed to the same non-zero value even though nothing in the destructor is doing anything.
Earle F. Philhower, III
@earlephilhower
If you were able to set anything to the static variable, it's not in flash for sure (you'd fault writing anything to it). There is no data copied automatically from flash to ram after BSS is initialized at system startup. Very odd thing you're seeing!
Sam Kendrick
@adnauseum
Hi all, I finished my first IoT project ever! It's a bathroom door monitor for my workplace. It is really simple; just hits a lambda function to modify a piece of state in a DB. I integrated it with Slack, so the status can be queried. I'm know my code is pretty poor, but I was making this during my brief lunch breaks :-D https://github.com/adnauseum/esp8266-door-monitor/blob/master/arduino_code/door-monitor.ino
Bert Melis
@bertmelis
how do you printf a uint64_t? I tried snprintf(str, sizeof(str), "%" PRIu64, value); but it prints "lu"
Bert Melis
@bertmelis
Anyone? Is my code wrong of is there a bug of is this feature just missing?
Myles Eftos
@madpilot
The formatted should be “%lu”
Wait. Sorry. Ignore
david gauchard
@d-a-v
%llu ?
or %Lu ?
Bert Melis
@bertmelis
%llu prints "lu"
%Lu does the trick. I thought uint64_t is a long long unsigned int, but it is a long double when I follow printf's logic
Redferne Bellini
@Redferne
Haha. Was really upset about this last week. Thanks, %Lu to printf a uint64_t. Why in gaawks name is PRIu64 defined as %lu?
Bert Melis
@bertmelis
so it is a bug, or intended? And it's SDK code, not Arduino.
Me No Dev
@me-no-dev
unsigned int on 32 bit system is uint32_t. unsigned long int is uint64_t
Bert Melis
@bertmelis
now I'm completely lost
millis() returns uint32_t which is defined as unsigned long. In this logic, uint64_t is unsigned long long.
Bert Melis
@bertmelis
however, to printf uint64_t I have to use Lu which implicates this is a long double.
Me No Dev
@me-no-dev
uint32_t is unsigned int
int is int32_t (32 bit system)
millis returns unsigned long for compatibility probably
Bert Melis
@bertmelis
I take this from c_types.h:
typedef unsigned int        uint32;
typedef unsigned long long  uint64;
Me No Dev
@me-no-dev
hmmm.. that seems odd
Bert Melis
@bertmelis
same definitions in stdint.h. So it is very odd printf assumes uint64_t is a long double (which is something comepletely different off course)
maybe I'm looking in the wrong place. I looked into the headers at Arduino/tools/sdk/...
david gauchard
@d-a-v
This is not odd to me. On 32 bits archs, int/long are 32 and long long is 64. I just tested it again on the esp. It has to be noted that printf(%) deal with int(%d %i) long(%ld %li) or long long (%lld %lli %Ld %Li) (man printf is not clear, speaking of double for L but also saying it's a synonym of ll which applies to integers). It does not known int_t types. This is why these PRI* macro were introduced, and yes at least PRIu64 prints "lu" too here.
david gauchard
@d-a-v
on 32 and 64 bits archs, we can always cast to (unsigned) int and use %u/id for 32 bits, or cast to (unsigned) long long and use %Lu/id for 64 bits. At least until these PRI* macro are worked-out.
David Albert
@dalbert2

I am working on a wireless bridge device (like Zigbee to WiFi) and believe I need to turn off the WiFi in order to transmit in Zigbee for FCC compliance reasons.

I am disconnecting using the sequence WiFi.disconnect(true); WiFi.mode(WIFI_OFF); WiFi.forceSleepBegin();. I re-enable using WiFi.forceSleepWake(); WiFi.persistent(false); WiFi.mode(WIFI_STA); WiFi.begin(mySsid, myPsk);

This works, but as soon as I re-enabled WiFi, the onSTAGotIP() callback is invoked with a null IP address and it is not invoked again when the IP address is actually received via DHCP. Is this expected behavior or should I file a problem ticket?

Bert Melis
@bertmelis
silly question maybe, but what is the c++ (standard) version of the compiler? Or where can I find out?
Clemens Kirchgatterer
@everslick
somewhere in the tools directory is the toolchain. the compiler takes the command line parameter --version and will happily report its version if asked nicely.
../../Arduino-ESP8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ --version
xtensa-lx106-elf-g++ (crosstool-NG 1.20.0) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Develo
@devyte
C++11. Be aware that stdlibc++ support is incomplete.
Bert Melis
@bertmelis
thanks, where did you find this info?
Clemens Kirchgatterer
@everslick
sankarsurya
@sankarsurya
if anyone knows the esp32 arduino spi master receive code
Me No Dev
@me-no-dev
@sankarsurya there is no point to ask this again here
do some googling, read some examples... it's pretty straight-forward peripheral
Bert Melis
@bertmelis
Do I understand correctly that os_strcpy or ets_strcpy optimized versions of the standard C function strcpy? (for example, complete list in osapi.h)
Is there any reason to use the non API versions?
Develo
@devyte
@bertmelis I'm not sure about this, but I think they all map to the same underlying function