Nfc: fix incorrect type castings. Global: fix printf usage, types casting, overall cleanup. Drivers: incorrect array index in cc1101 driver. (#713)

* fix 'function cannot return qualified void/bool type'
* Fix variable 'consumed' is used uninitialized
* Fix format string is not a string literal (potentially insecure)
* Fix conflicting types for 'menu_item_get_type'
* Fix implicit conversion from enumeration type 'NfcDeviceType' to different enumeration type 'rfalNfcDevType'
* Fix hal_gpio_init incorrect arguments order
* Fix nfc->dev.dev_name condition will always evaluate to 'true'
* Fix explicitly assigning value of variable to itself
* Fix furi_hal_bt_wait_startup counter overflow
* Fix implicit conversion from 'StorageStatus' to 'SDError'
* Remove #include <sys/param.h>
* Add FIXME
* Fix syntax
* Fixup for 'furi_hal_bt_wait_startup counter overflow'
* nfc: fix different nfc device types
* Drivers: fix incorrect offset in cc1101_read_fifo
* Remove obsolete comment

Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
tonyfreeman
2021-09-21 12:34:16 +03:00
committed by GitHub
parent 9b0aa0d6dc
commit 69f54973cc
63 changed files with 180 additions and 166 deletions

View File

@@ -61,7 +61,7 @@ bool furi_hal_bt_is_active() {
}
bool furi_hal_bt_wait_startup() {
uint8_t counter = 0;
uint16_t counter = 0;
while (!(APPE_Status() == BleGlueStatusStarted || APPE_Status() == BleGlueStatusBroken)) {
osDelay(10);
counter++;

View File

@@ -3,12 +3,12 @@
void furi_hal_ibutton_start() {
furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
}
void furi_hal_ibutton_stop() {
furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
}
void furi_hal_ibutton_pin_low() {

View File

@@ -18,11 +18,11 @@ void furi_hal_rfid_pins_reset() {
furi_hal_ibutton_stop();
// pulldown rfid antenna
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false);
// from both sides
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, true);
}
@@ -36,7 +36,7 @@ void furi_hal_rfid_pins_emulate() {
&gpio_rfid_pull, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2);
// pull rfid antenna from carrier side
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false);
}
@@ -46,7 +46,7 @@ void furi_hal_rfid_pins_read() {
furi_hal_ibutton_pin_low();
// dont pull rfid antenna
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, false);
// carrier pin to timer out
@@ -58,7 +58,7 @@ void furi_hal_rfid_pins_read() {
GpioAltFn1TIM1);
// comparator in
hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioSpeedLow, GpioPullNo);
hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
}
void furi_hal_rfid_tim_read(float freq, float duty_cycle) {