Is There a Way to Force Full Clean on Build?

Hi guys. Is there a way I can force a Full Clean for every build? Like anything I can put in the platform.ini file so I don’t have to manually click the “Full Clean” button before build?

The problem is that I’m using a callback in a class definition in a custom header file and platformIO isn’t picking up changes to that class definition. Any changes to the implementation file are picked up fine, but not the header.

The .h and .cpp files are in their own folder under src. The header is properly included in main.cpp. And I reference the custom folder under lib_deps in my ini file like this:
lib_deps =
/Users/casi/Documents/PlatformIO/Projects/Lil Joey Master/src/BLE_LJ

lib_ldf_mode = deep

This is a snippet from my header file (some variables removed) but basically any changes I make under class CharacteristicsCallBack aren’t picked up. No new code, Serial.prints, nothing. So basically I need to do a Full Clean every time.

#ifndef BLE_LJ_H
#define BLE_LJ_H

#include <Arduino.h>
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

class CharacteristicsCallBack: public BLECharacteristicCallbacks {
      void onWrite(BLECharacteristic *pChar) override { 
            if(pChar->getUUID().toString() == CHARACTERISTIC_UUID_2) {

                  uint8_t* pChar2Data = pChar->getData();
                  uint8_t command = pChar2Data[0]

                  if (command == 1) {
                  } else if (command == 2) {
                        Serial.println("in switch call");
                        commandCode = 1;
                  } else if (command == 11) {
                        Serial.println("in 11 call v3");
                        if (learnMode == HIGH) {
                  } else if (command == 22) {
                        currentRequestedPacket = pChar2Data[3];
                        debugf("requested packet start: %i\n", currentRequestedPacket);
                        size_t packetSize = strlen(reinterpret_cast<char*>(pChar2Data));
                        pCharacteristic_1->setValue(pChar2Data, packetSize); 
                  } else if (command == 88) {
                        uint8_t l_recordingSlot = pChar2Data[1];
                        uint8_t firstByte = pChar2Data[2];
                        uint8_t secondByte = pChar2Data[3];
                        uint16_t cutOffCurrent = (static_cast<uint16_t>(firstByte) << 8) | secondByte;
                        uint8_t cutOffDelay = pChar2Data[4];

                        char slotName[15];
                        for (int i = 0; i < 15; i++) {
                              slotName[i] = pChar2Data[i + 5];
                        currentSavePreset.recordingSlot = l_recordingSlot;
                        strcpy(currentSavePreset.slotName, slotName);
                        currentSavePreset.cutOffCurrent = cutOffCurrent;
                        currentSavePreset.cutOffDelay = cutOffDelay;
                        commandCode = 88;               
                  } else if (command == 99) {
                        commandCode = 99;                        
      void onRead(BLECharacteristic *pChar) override { 
            Serial.println("Accessing onRead");
            if(pChar->getUUID().toString() == CHARACTERISTIC_UUID_3) {
                  if (currentRequestedPacket > 0) {
                        if (learnMode == HIGH) {
                              packagePacket(33, currentRecordingBuffer, currentRequestedPacket, pCharacteristic_3);
                        } else {
                              //packagePacket(currentBuffer, pCharacteristic_3);      
                  Serial.println("sanity check");
                  //debugf("currentPacket: %i\n", currentPacket);

That’s fine!

What do you mean by “properly included”?
The correct way to include files located in a subfolder of src would be

#include "./mysubfolder/myheader.h"

Don’t do this! It’s not necessary to list your own source-files again as dependencies.

1 Like

Wow. Ok, this was my problem. Guess I went roundabouts with trying to do the other stuff. Just got thrown off because platformIO was still finding the files with a Full Clean. Thanks so much! I spent hours trying to sort this out.

And removed the lib_deps stuff too. Thanks!

1 Like