Merge remote-tracking branch 'origin/dev' into release-candidate
@ -359,13 +359,13 @@ static void bt_change_profile(Bt* bt, BtMessage* message) {
|
|||||||
*message->result = false;
|
*message->result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
furi_event_flag_set(bt->api_event, BT_API_UNLOCK_EVENT);
|
api_lock_unlock(message->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bt_close_connection(Bt* bt) {
|
static void bt_close_connection(Bt* bt, BtMessage* message) {
|
||||||
bt_close_rpc_connection(bt);
|
bt_close_rpc_connection(bt);
|
||||||
furi_hal_bt_stop_advertising();
|
furi_hal_bt_stop_advertising();
|
||||||
furi_event_flag_set(bt->api_event, BT_API_UNLOCK_EVENT);
|
api_lock_unlock(message->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t bt_srv(void* p) {
|
int32_t bt_srv(void* p) {
|
||||||
@ -432,7 +432,7 @@ int32_t bt_srv(void* p) {
|
|||||||
} else if(message.type == BtMessageTypeSetProfile) {
|
} else if(message.type == BtMessageTypeSetProfile) {
|
||||||
bt_change_profile(bt, &message);
|
bt_change_profile(bt, &message);
|
||||||
} else if(message.type == BtMessageTypeDisconnect) {
|
} else if(message.type == BtMessageTypeDisconnect) {
|
||||||
bt_close_connection(bt);
|
bt_close_connection(bt, &message);
|
||||||
} else if(message.type == BtMessageTypeForgetBondedDevices) {
|
} else if(message.type == BtMessageTypeForgetBondedDevices) {
|
||||||
bt_keys_storage_delete(bt->keys_storage);
|
bt_keys_storage_delete(bt->keys_storage);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,14 @@ bool bt_set_profile(Bt* bt, BtProfile profile) {
|
|||||||
// Send message
|
// Send message
|
||||||
bool result = false;
|
bool result = false;
|
||||||
BtMessage message = {
|
BtMessage message = {
|
||||||
.type = BtMessageTypeSetProfile, .data.profile = profile, .result = &result};
|
.lock = api_lock_alloc_locked(),
|
||||||
|
.type = BtMessageTypeSetProfile,
|
||||||
|
.data.profile = profile,
|
||||||
|
.result = &result};
|
||||||
furi_check(
|
furi_check(
|
||||||
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||||
// Wait for unlock
|
// Wait for unlock
|
||||||
furi_event_flag_wait(bt->api_event, BT_API_UNLOCK_EVENT, FuriFlagWaitAny, FuriWaitForever);
|
api_lock_wait_unlock_and_free(message.lock);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -19,11 +22,11 @@ void bt_disconnect(Bt* bt) {
|
|||||||
furi_assert(bt);
|
furi_assert(bt);
|
||||||
|
|
||||||
// Send message
|
// Send message
|
||||||
BtMessage message = {.type = BtMessageTypeDisconnect};
|
BtMessage message = {.lock = api_lock_alloc_locked(), .type = BtMessageTypeDisconnect};
|
||||||
furi_check(
|
furi_check(
|
||||||
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||||
// Wait for unlock
|
// Wait for unlock
|
||||||
furi_event_flag_wait(bt->api_event, BT_API_UNLOCK_EVENT, FuriFlagWaitAny, FuriWaitForever);
|
api_lock_wait_unlock_and_free(message.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bt_set_status_changed_callback(Bt* bt, BtStatusChangedCallback callback, void* context) {
|
void bt_set_status_changed_callback(Bt* bt, BtStatusChangedCallback callback, void* context) {
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
#include <api_lock.h>
|
||||||
|
|
||||||
#include <gui/gui.h>
|
#include <gui/gui.h>
|
||||||
#include <gui/view_port.h>
|
#include <gui/view_port.h>
|
||||||
@ -22,8 +23,6 @@
|
|||||||
|
|
||||||
#define BT_KEYS_STORAGE_PATH INT_PATH(BT_KEYS_STORAGE_FILE_NAME)
|
#define BT_KEYS_STORAGE_PATH INT_PATH(BT_KEYS_STORAGE_FILE_NAME)
|
||||||
|
|
||||||
#define BT_API_UNLOCK_EVENT (1UL << 0)
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BtMessageTypeUpdateStatus,
|
BtMessageTypeUpdateStatus,
|
||||||
BtMessageTypeUpdateBatteryLevel,
|
BtMessageTypeUpdateBatteryLevel,
|
||||||
@ -48,6 +47,7 @@ typedef union {
|
|||||||
} BtMessageData;
|
} BtMessageData;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
FuriApiLock lock;
|
||||||
BtMessageType type;
|
BtMessageType type;
|
||||||
BtMessageData data;
|
BtMessageData data;
|
||||||
bool* result;
|
bool* result;
|
||||||
|
|||||||
@ -422,9 +422,7 @@ int32_t hid_ble_app(void* p) {
|
|||||||
|
|
||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
|
||||||
if(!bt_set_profile(app->bt, BtProfileHidKeyboard)) {
|
furi_check(bt_set_profile(app->bt, BtProfileHidKeyboard));
|
||||||
FURI_LOG_E(TAG, "Failed to switch to HID profile");
|
|
||||||
}
|
|
||||||
|
|
||||||
furi_hal_bt_start_advertising();
|
furi_hal_bt_start_advertising();
|
||||||
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);
|
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);
|
||||||
@ -442,9 +440,7 @@ int32_t hid_ble_app(void* p) {
|
|||||||
|
|
||||||
bt_keys_storage_set_default_path(app->bt);
|
bt_keys_storage_set_default_path(app->bt);
|
||||||
|
|
||||||
if(!bt_set_profile(app->bt, BtProfileSerial)) {
|
furi_check(bt_set_profile(app->bt, BtProfileSerial));
|
||||||
FURI_LOG_E(TAG, "Failed to switch to Serial profile");
|
|
||||||
}
|
|
||||||
|
|
||||||
hid_free(app);
|
hid_free(app);
|
||||||
|
|
||||||
|
|||||||
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_0.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_1.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_10.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_11.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_12.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_13.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_14.png
vendored
Normal file
|
After Width: | Height: | Size: 968 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_15.png
vendored
Normal file
|
After Width: | Height: | Size: 971 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_16.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_17.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_18.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_19.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_2.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_20.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_21.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_22.png
vendored
Normal file
|
After Width: | Height: | Size: 1021 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_23.png
vendored
Normal file
|
After Width: | Height: | Size: 929 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_24.png
vendored
Normal file
|
After Width: | Height: | Size: 856 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_25.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_26.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_27.png
vendored
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_28.png
vendored
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_29.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_3.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_30.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_31.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_32.png
vendored
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_33.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_34.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_35.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_36.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_37.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_38.png
vendored
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_39.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_4.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_40.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_41.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_42.png
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_43.png
vendored
Normal file
|
After Width: | Height: | Size: 1004 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_44.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_45.png
vendored
Normal file
|
After Width: | Height: | Size: 645 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_46.png
vendored
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_47.png
vendored
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_48.png
vendored
Normal file
|
After Width: | Height: | Size: 925 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_49.png
vendored
Normal file
|
After Width: | Height: | Size: 911 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_5.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_50.png
vendored
Normal file
|
After Width: | Height: | Size: 880 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_51.png
vendored
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_52.png
vendored
Normal file
|
After Width: | Height: | Size: 876 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_53.png
vendored
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_54.png
vendored
Normal file
|
After Width: | Height: | Size: 913 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_55.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_56.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_57.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_58.png
vendored
Normal file
|
After Width: | Height: | Size: 974 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_59.png
vendored
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_6.png
vendored
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_60.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_61.png
vendored
Normal file
|
After Width: | Height: | Size: 1011 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_7.png
vendored
Normal file
|
After Width: | Height: | Size: 988 B |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_8.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/dolphin/external/L2_Coding_in_the_shell_128x64/frame_9.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
23
assets/dolphin/external/L2_Coding_in_the_shell_128x64/meta.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Filetype: Flipper Animation
|
||||||
|
Version: 1
|
||||||
|
|
||||||
|
Width: 128
|
||||||
|
Height: 64
|
||||||
|
Passive frames: 21
|
||||||
|
Active frames: 44
|
||||||
|
Frames order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 17 19 20 21 22 23 24 24 25 26 27 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
||||||
|
Active cycles: 1
|
||||||
|
Frame rate: 2
|
||||||
|
Duration: 3600
|
||||||
|
Active cooldown: 7
|
||||||
|
|
||||||
|
Bubble slots: 1
|
||||||
|
|
||||||
|
Slot: 0
|
||||||
|
X: 7
|
||||||
|
Y: 46
|
||||||
|
Text: GOOD JOB!
|
||||||
|
AlignH: Center
|
||||||
|
AlignV: Top
|
||||||
|
StartFrame: 54
|
||||||
|
EndFrame: 57
|
||||||
7
assets/dolphin/external/manifest.txt
vendored
@ -168,3 +168,10 @@ Max butthurt: 13
|
|||||||
Min level: 1
|
Min level: 1
|
||||||
Max level: 3
|
Max level: 3
|
||||||
Weight: 4
|
Weight: 4
|
||||||
|
|
||||||
|
Name: L2_Coding_in_the_shell_128x64
|
||||||
|
Min butthurt: 0
|
||||||
|
Max butthurt: 12
|
||||||
|
Min level: 2
|
||||||
|
Max level: 3
|
||||||
|
Weight: 4
|
||||||
|
|||||||
@ -181,9 +181,11 @@ static void ble_app_hci_event_handler(void* pPayload) {
|
|||||||
|
|
||||||
static void ble_app_hci_status_not_handler(HCI_TL_CmdStatus_t status) {
|
static void ble_app_hci_status_not_handler(HCI_TL_CmdStatus_t status) {
|
||||||
if(status == HCI_TL_CmdBusy) {
|
if(status == HCI_TL_CmdBusy) {
|
||||||
|
furi_hal_power_insomnia_enter();
|
||||||
furi_mutex_acquire(ble_app->hci_mtx, FuriWaitForever);
|
furi_mutex_acquire(ble_app->hci_mtx, FuriWaitForever);
|
||||||
} else if(status == HCI_TL_CmdAvailable) {
|
} else if(status == HCI_TL_CmdAvailable) {
|
||||||
furi_mutex_release(ble_app->hci_mtx);
|
furi_mutex_release(ble_app->hci_mtx);
|
||||||
|
furi_hal_power_insomnia_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include <hsem_map.h>
|
#include <hsem_map.h>
|
||||||
|
|
||||||
#include <furi_hal_version.h>
|
#include <furi_hal_version.h>
|
||||||
|
#include <furi_hal_power.h>
|
||||||
#include <furi_hal_bt_hid.h>
|
#include <furi_hal_bt_hid.h>
|
||||||
#include <furi_hal_bt_serial.h>
|
#include <furi_hal_bt_serial.h>
|
||||||
#include <furi_hal_bus.c>
|
#include <furi_hal_bus.c>
|
||||||
@ -269,6 +270,7 @@ bool furi_hal_bt_start_app(FuriHalBtProfile profile, GapEventCallback event_cb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void furi_hal_bt_reinit() {
|
void furi_hal_bt_reinit() {
|
||||||
|
furi_hal_power_insomnia_enter();
|
||||||
FURI_LOG_I(TAG, "Disconnect and stop advertising");
|
FURI_LOG_I(TAG, "Disconnect and stop advertising");
|
||||||
furi_hal_bt_stop_advertising();
|
furi_hal_bt_stop_advertising();
|
||||||
|
|
||||||
@ -298,6 +300,7 @@ void furi_hal_bt_reinit() {
|
|||||||
furi_hal_bt_init();
|
furi_hal_bt_init();
|
||||||
|
|
||||||
furi_hal_bt_start_radio_stack();
|
furi_hal_bt_start_radio_stack();
|
||||||
|
furi_hal_power_insomnia_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool furi_hal_bt_change_app(FuriHalBtProfile profile, GapEventCallback event_cb, void* context) {
|
bool furi_hal_bt_change_app(FuriHalBtProfile profile, GapEventCallback event_cb, void* context) {
|
||||||
|
|||||||
@ -29,22 +29,26 @@ which is the name that most clang tools search for by default.
|
|||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
|
|
||||||
import json
|
|
||||||
import itertools
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
import itertools
|
||||||
|
import json
|
||||||
|
from shlex import quote
|
||||||
|
|
||||||
import SCons
|
import SCons
|
||||||
|
from SCons.Tool.asm import ASPPSuffixes, ASSuffixes
|
||||||
from SCons.Tool.cxx import CXXSuffixes
|
|
||||||
from SCons.Tool.cc import CSuffixes
|
from SCons.Tool.cc import CSuffixes
|
||||||
from SCons.Tool.asm import ASSuffixes, ASPPSuffixes
|
from SCons.Tool.cxx import CXXSuffixes
|
||||||
|
|
||||||
# TODO FL-3542: Is there a better way to do this than this global? Right now this exists so that the
|
# TODO: (-nofl) Is there a better way to do this than this global? Right now this exists so that the
|
||||||
# emitter we add can record all of the things it emits, so that the scanner for the top level
|
# emitter we add can record all of the things it emits, so that the scanner for the top level
|
||||||
# compilation database can access the complete list, and also so that the writer has easy
|
# compilation database can access the complete list, and also so that the writer has easy
|
||||||
# access to write all of the files. But it seems clunky. How can the emitter and the scanner
|
# access to write all of the files. But it seems clunky. How can the emitter and the scanner
|
||||||
# communicate more gracefully?
|
# communicate more gracefully?
|
||||||
__COMPILATION_DB_ENTRIES = []
|
__COMPILATION_DB_ENTRIES = []
|
||||||
|
|
||||||
|
# We cache the tool path lookups to avoid doing them over and over again.
|
||||||
|
_TOOL_PATH_CACHE = {}
|
||||||
|
|
||||||
|
|
||||||
# We make no effort to avoid rebuilding the entries. Someday, perhaps we could and even
|
# We make no effort to avoid rebuilding the entries. Someday, perhaps we could and even
|
||||||
# integrate with the cache, but there doesn't seem to be much call for it.
|
# integrate with the cache, but there doesn't seem to be much call for it.
|
||||||
@ -91,7 +95,7 @@ def make_emit_compilation_DB_entry(comstr):
|
|||||||
__COMPILATIONDB_ENV=env,
|
__COMPILATIONDB_ENV=env,
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO FL-3541: Technically, these next two lines should not be required: it should be fine to
|
# TODO: (-nofl) Technically, these next two lines should not be required: it should be fine to
|
||||||
# cache the entries. However, they don't seem to update properly. Since they are quick
|
# cache the entries. However, they don't seem to update properly. Since they are quick
|
||||||
# to re-generate disable caching and sidestep this problem.
|
# to re-generate disable caching and sidestep this problem.
|
||||||
env.AlwaysBuild(entry)
|
env.AlwaysBuild(entry)
|
||||||
@ -122,6 +126,17 @@ def compilation_db_entry_action(target, source, env, **kw):
|
|||||||
env=env["__COMPILATIONDB_ENV"],
|
env=env["__COMPILATIONDB_ENV"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# We assume first non-space character is the executable
|
||||||
|
executable = command.split(" ", 1)[0]
|
||||||
|
if not (tool_path := _TOOL_PATH_CACHE.get(executable, None)):
|
||||||
|
tool_path = env.WhereIs(executable) or executable
|
||||||
|
_TOOL_PATH_CACHE[executable] = tool_path
|
||||||
|
# If there are spaces in the executable path, we need to quote it
|
||||||
|
if " " in tool_path:
|
||||||
|
tool_path = quote(tool_path)
|
||||||
|
# Replacing the executable with the full path
|
||||||
|
command = tool_path + command[len(executable) :]
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
"directory": env.Dir("#").abspath,
|
"directory": env.Dir("#").abspath,
|
||||||
"command": command,
|
"command": command,
|
||||||
@ -242,10 +257,7 @@ def generate(env, **kwargs):
|
|||||||
for entry in components_by_suffix:
|
for entry in components_by_suffix:
|
||||||
suffix = entry[0]
|
suffix = entry[0]
|
||||||
builder, base_emitter, command = entry[1]
|
builder, base_emitter, command = entry[1]
|
||||||
|
if emitter := builder.emitter.get(suffix, False):
|
||||||
# Assumes a dictionary emitter
|
|
||||||
emitter = builder.emitter.get(suffix, False)
|
|
||||||
if emitter:
|
|
||||||
# We may not have tools installed which initialize all or any of
|
# We may not have tools installed which initialize all or any of
|
||||||
# cxx, cc, or assembly. If not skip resetting the respective emitter.
|
# cxx, cc, or assembly. If not skip resetting the respective emitter.
|
||||||
builder.emitter[suffix] = SCons.Builder.ListEmitter(
|
builder.emitter[suffix] = SCons.Builder.ListEmitter(
|
||||||
|
|||||||
@ -2,8 +2,6 @@ import subprocess
|
|||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import objdump
|
import objdump
|
||||||
import shutil
|
|
||||||
|
|
||||||
import strip
|
import strip
|
||||||
from SCons.Action import _subproc
|
from SCons.Action import _subproc
|
||||||
from SCons.Errors import StopError
|
from SCons.Errors import StopError
|
||||||
@ -13,20 +11,25 @@ from SCons.Tool import ar, asm, gcc, gnulink, gxx
|
|||||||
def prefix_commands(env, command_prefix, cmd_list):
|
def prefix_commands(env, command_prefix, cmd_list):
|
||||||
for command in cmd_list:
|
for command in cmd_list:
|
||||||
if command in env:
|
if command in env:
|
||||||
env[command] = shutil.which(command_prefix + env[command])
|
prefixed_binary = command_prefix + env[command]
|
||||||
|
if not env.WhereIs(prefixed_binary):
|
||||||
|
raise StopError(
|
||||||
|
f"Toolchain binary {prefixed_binary} not found in PATH."
|
||||||
|
)
|
||||||
|
env.Replace(**{command: prefixed_binary})
|
||||||
|
|
||||||
|
|
||||||
def _get_tool_version(env, tool):
|
def _get_tool_version(env, tool):
|
||||||
verstr = "version unknown"
|
verstr = "version unknown"
|
||||||
proc = _subproc(
|
proc = _subproc(
|
||||||
env,
|
env,
|
||||||
env.subst("${%s} --version" % tool),
|
[env.subst("${%s}" % tool), "--version"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr="devnull",
|
stderr="devnull",
|
||||||
stdin="devnull",
|
stdin="devnull",
|
||||||
universal_newlines=True,
|
universal_newlines=True,
|
||||||
error="raise",
|
error="raise",
|
||||||
shell=True,
|
shell=False,
|
||||||
)
|
)
|
||||||
if proc:
|
if proc:
|
||||||
verstr = proc.stdout.readline()
|
verstr = proc.stdout.readline()
|
||||||
|
|||||||
@ -48,6 +48,7 @@ def generate(env):
|
|||||||
"@.pvsoptions",
|
"@.pvsoptions",
|
||||||
"-j${PVSNCORES}",
|
"-j${PVSNCORES}",
|
||||||
# "--incremental", # kinda broken on PVS side
|
# "--incremental", # kinda broken on PVS side
|
||||||
|
"--disableLicenseExpirationCheck",
|
||||||
],
|
],
|
||||||
PVSCONVOPTIONS=[
|
PVSCONVOPTIONS=[
|
||||||
"-a",
|
"-a",
|
||||||
|
|||||||