Skip to content
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

Update clang format #41

Merged
merged 6 commits into from
Feb 21, 2024
Merged

Update clang format #41

merged 6 commits into from
Feb 21, 2024

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Feb 20, 2024

satisfy nRF24/.github#9

This comment was marked as duplicate.

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 20, 2024

Builds on STM32 blue pill are failing:

Compiling .pio/build/bluepill_f103c8/lib75e/RF24Network/RF24Network.cpp.o
In file included from /home/runner/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38:
/home/runner/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h: In function 'int _gettimeofday(timeval*, void*)':
/home/runner/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:106:16: error: 'getCurrentMillis' was not declared in this scope
  106 |   tv->tv_sec = getCurrentMillis() / 1000;
      |                ^~~~~~~~~~~~~~~~
/home/runner/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:107:17: error: 'getCurrentMicros' was not declared in this scope
  107 |   tv->tv_usec = getCurrentMicros() - (tv->tv_sec * 1000000);  // get remaining microseconds
      |                 ^~~~~~~~~~~~~~~~
*** [.pio/build/bluepill_f103c8/src/InteractiveServer_Mesh.ino.cpp.o] Error 1

I think this is related to the file name conflict about the core's clock.h and this lib's clock_arch.h, but I'm guessing it may be more specific to the header guards used:

In cores/arduino/stm32/clock.h (where getCurrentMicros() is declared):

#ifndef __CLOCK_H
#define __CLOCK_H

which is similar to this lib's clock_arch.h

#ifndef clock_h_
#define clock_h_

I don't know if the compiler used is doing other stuff to the header guards though. Seems like the _ and case sensitivity should be enough to distinguish the 2 differently named files... 🤷🏼‍♂️

This comment was marked as duplicate.

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 20, 2024

Damn. That header guard thing was my best guess. I have no idea why getCurrentMicros() is undefined on the stm32 blue pill.

@TMRh20
Copy link
Member

TMRh20 commented Feb 20, 2024

Hmm, seems to compile in the Arduino IDE, not sure if I have the right board selected tho, not finding a Blue Pill specific option but using Generic STM32F1 and other cores works fine.

@TMRh20
Copy link
Member

TMRh20 commented Feb 20, 2024

Same exact error in platformio tho

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 20, 2024

Are you using the stm32duino core?

"blue pill" is the surname for a generic STM32F103C8. Some chinese manufacturers made black pills with the STM32F103C8, but typically "black pill" is a surname for the STM32F403C6 (I think).

I believe platformIO is also using the stm32duino core for the arduino framework as well.

To the best of my knowledge, I have to use PIO in CI because there is no apparent way to install stm32duino without using the graphic installer (instead of a CLI installer). PIO allows me to avoid that hurdle because the CI runner cannot run apps with a GUI.

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 20, 2024

To the best of my knowledge, I have to use PIO in CI because there is no apparent way to install stm32duino without using the graphic installer (instead of a CLI installer). PIO allows me to avoid that hurdle because the CI runner cannot run apps with a GUI.

This is incorrect. I can use a json to install stm32duino like all other cores. I don't know how I missed this; json has been available since 2018 (v1.2.0).

I'll try and switch this in CI to arduino instead of PIO.

PS: You can select different variations of the blue pill under the tools -> "board part number" menu in Arduino IDE (after selecting generic STM32F1 board).

This comment was marked as duplicate.

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 20, 2024

CI passes now (including blue pill using Arduino). All other source changes just look like a block got indented.

@2bndy5 2bndy5 requested a review from TMRh20 February 20, 2024 14:09
@TMRh20
Copy link
Member

TMRh20 commented Feb 20, 2024 via email

@TMRh20 TMRh20 mentioned this pull request Feb 20, 2024
Copy link
Contributor

Memory usage change @ f9881f5

Board flash % RAM for global variables %
arduino:avr:nano 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Getting_Started_SimpleClient_Mesh
flash
% examples/Getting_Started_SimpleClient_Mesh
RAM for global variables
% examples/Getting_Started_SimpleServer_Mesh
flash
% examples/Getting_Started_SimpleServer_Mesh
RAM for global variables
% examples/InteractiveServer_Mesh
flash
% examples/InteractiveServer_Mesh
RAM for global variables
% examples/MQTT/mqtt_basic
flash
% examples/MQTT/mqtt_basic
RAM for global variables
% examples/MQTT/mqtt_basic_2
flash
% examples/MQTT/mqtt_basic_2
RAM for global variables
% examples/SimpleClient_Mesh
flash
% examples/SimpleClient_Mesh
RAM for global variables
%
arduino:avr:nano 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrzero 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/Getting_Started_SimpleClient_Mesh<br>flash,%,examples/Getting_Started_SimpleClient_Mesh<br>RAM for global variables,%,examples/Getting_Started_SimpleServer_Mesh<br>flash,%,examples/Getting_Started_SimpleServer_Mesh<br>RAM for global variables,%,examples/InteractiveServer_Mesh<br>flash,%,examples/InteractiveServer_Mesh<br>RAM for global variables,%,examples/MQTT/mqtt_basic<br>flash,%,examples/MQTT/mqtt_basic<br>RAM for global variables,%,examples/MQTT/mqtt_basic_2<br>flash,%,examples/MQTT/mqtt_basic_2<br>RAM for global variables,%,examples/SimpleClient_Mesh<br>flash,%,examples/SimpleClient_Mesh<br>RAM for global variables,%
arduino:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@2bndy5
Copy link
Member Author

2bndy5 commented Feb 21, 2024

I moved blue pill build back to PIO CI, and it works fine with the new changes from #42.

I still don't know why it worked with the Arduino CLI and not with PIO before #42, but I'm keeping the blue pill build in PIO CI just to be sure in the future.

@2bndy5 2bndy5 merged commit 97a2c73 into master Feb 21, 2024
61 checks passed
@2bndy5 2bndy5 deleted the update-clang-format branch February 21, 2024 00:12
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