Commit Graph

71 Commits

Author SHA1 Message Date
あく
6c4983c6b6
HAL Timebase, Power, Clock: semaphore guarded access to clock and power modes, better sleep mode. (#307) 2021-01-20 10:43:12 +03:00
あく
c8aca9ef48
[FL-667] Power saving: deep sleep in tickless state (#300)
* SYSTEM: tickless mode with deep sleep.
* Move FreeRTOS ticks to lptim2.
* API: move all sumbodules init routines to one place.
* Timebase: working lptim2 at tick source.
* API Timebase: lp-timer routines, timer access safe zones prediction and synchronization. 
* FreeRTOS: adjust configuration for tickless mode.
* NFC: support for tickless mode.
* API Timebase: improve tick error handling in IRQ. 
* Apploader: use insomnia mode to run applications.
* BLE: prevent sleep while core2 starting.
* HAL: nap while in insomnia mode.

Co-authored-by: coreglitch <mail@s3f.ru>
2021-01-18 18:08:58 +03:00
DrZlo13
9ed8bebba1
SPI Device API (#304)
* spi device config
* fix api_interrupt_call warning
* added configs for spi2 bus devices
* simplified spi bus api
* use new spi device api
2021-01-12 20:33:36 +03:00
DrZlo13
f94633863c
[FL-520] Filesystem Api and App (#280)
* update fatfs integer types
* fix sector size to 512
* fix sector size calculation
* common fs api
* fs api realization (sd card + fat fs)
* better sector size definition
* more api realization fns
* add error description api, add common api
* fix api flag naming, run app
* add fs_info call
* disable fatfs strfuncs, enable fatfs chmod
* rework filesystem app
* sd detect cycle, sd menu, sd eject feature
* fix sd detect cycle
* sd card format routine
* ui improvements, sd info routine
* properly unmount card
* separate mode flags
* add api folder, move app, rename app
* fix api naming
* update st-card-test to use api
* update path to app
* fixed potential problem of using sizeof union
* updated api documentation, new time/date fns
* update codeowners
* changed app requirements
* changed app order
* sd insert/remove log
2021-01-11 20:52:35 +06:00
あく
6928122650
FL-53: new NFC worker, A/B/F/V poll and display. (#283)
* GUI: view. Flooper-blooper fix compilation error.
* GUI: view and viewdispatcher bones
* GUI: view implementation, view models, view dispatcher
* GUI: view navigation, model refinement. Power: use view, view dispatcher.

* HAL Flash: proper page write. Dolphin: views. Power: views

* Dolphin: transition idle scree to Views
* Dolphin: input events on stats view. Format sources.

* HAL: flash erase. Dolphin: permanent state storage.

* Dolphin: first start welcome. HAL: flash operation status, errata 2.2.9 crutch.

* NFC: rewrite worker
* NFC: add support for B,F,V.
* NFC: replace rfal irq hanlder with realtime thread, more details about cards.

* Bootloader: LSE and RTS shenanigans, LED control, morse code for LSE failure error.

* F4: stop in Error_Handler

* BLE: handle working FUS, but empty radio stack.

* HAL: alive FUS is now sufficient for flash controller access

* Dolphin: update model after state load

* NFC: detect navigation

* RFAL: use osPriorityISR for isr thread

* NFC: emulation

* Bootloader: rollback incorrectly merged rename

* Dolphin: rollback incorrectly merged changes

* RFAL: remove volatile from thread attr

* RFAL: do not call platform ErrorHandler, error codes is enough

* NFC: improved error handling

* Format sources

* NFC: reset detect view model on start

* Format sources

* update codeowners

* NFC: hide last info if no card detected
2021-01-11 18:42:25 +06:00
あく
2cfe80cc36
Debug: add openocd freertos support (#302) 2021-01-11 14:27:20 +03:00
あく
1b78418f9f
FL-528 GUI: View, ViewDispather. Dolphin: first start. (#276)
* GUI: view. Flooper-blooper fix compilation error.
* GUI: view and viewdispatcher bones
* GUI: view implementation, view models, view dispatcher
* GUI: view navigation, model refinement. Power: use view, view dispatcher.
* HAL Flash: proper page write. Dolphin: views. Power: views
* Dolphin: transition idle scree to Views
* Dolphin: input events on stats view. Format sources.
* HAL: flash erase. Dolphin: permanent state storage.
* Dolphin: first start welcome. HAL: flash operation status, errata 2.2.9 crutch.
2021-01-08 10:42:48 +06:00
DrZlo13
d65e9b04ce
[FL-572][FL-577] Irda receive feature (#282)
* fix "state not acquired error"
* add InterruptTypeComparatorTrigger to interrupt mgr, use interrupt mgr in irda app
* separate init irda timer
* capture events buffer by app
* irda common decoder
* irda nec decoder realization
* finished work with decoder
* fix app path
* fix widget remove on exit
* nec receive, store and send
* init some packets
2021-01-07 22:28:35 +06:00
あく
88ed32483d
Power: set smps clock according to used inductor. RTC: do not reset clock on each start. (#281) 2021-01-07 02:03:37 +06:00
あく
bf97123ba8
Debug: adjust openocd config for max speed (#278) 2020-12-28 13:20:58 +06:00
あく
4a9e4074f7
Remove obsolete target. Cleanup and update ReadMe. (#279) 2020-12-28 11:52:35 +06:00
aanper
14d1325b17 rename ioc 2020-12-26 12:09:23 +06:00
あく
9a257b048e
Power: more info (#274) 2020-12-23 00:16:32 +06:00
DrZlo13
8b6e7fd4ae
FL-443 Move sd card to second spi (#271)
* sd card spi 2 fix, add spi mgr
2020-12-19 13:52:17 +06:00
あく
73ecc7cde6
Rename Irukagotchi to Dolphin. Add basic game state structures. (#268)
* Rename Irukagotchi to Dolphin. Add basic game state structures.
* Dolphin: state, counters, api. BT: shared access to flash. Flash: write api.
* add fake -1 deeds, example of changing icounter

Co-authored-by: coreglitch <mail@s3f.ru>
2020-12-19 02:15:29 +06:00
DrZlo13
3ba1738acd
FL-262 Interrupt manager (#270)
* interrupt manager
* init interrupt manager
* add usage to lf-rfid app
* check ready flag
* move interrupts code to target hal
* fix path
2020-12-19 01:26:03 +06:00
あく
153d32bf15
Power: info (#272) 2020-12-19 00:03:28 +06:00
coreglitch
c1c069e95f
F2 F3 deprecate (#267)
* move f3-1 to f4, remove f3
* remove f2
* remove firmware F3 for pipeline
* remove patch for F4 makefile
* fix fw makefile
* migrate bootloader to f4
2020-12-14 19:36:07 +03:00
coreglitch
ff7ce6f00f
swap PB3/PA5 for SWO exposing (#263) 2020-12-11 18:12:37 +03:00
あく
46537f4470
FL-501 CSS for both clock domains (#264)
* CSS for both clock domains. Stale LSE detection and RTC domain reset on start.
* migrate to f4

Co-authored-by: aanper <mail@s3f.ru>
2020-12-11 15:34:17 +03:00
aanper
df27d775bf increase max app count 2020-12-10 17:58:33 +03:00
あく
2f2f6b5f50
BLE: F3 integration (#260)
* BLE: working version
* BLE: cleanup
* BLE: update device description and DIS.
* BLE: explicitly take semaphore and configure CLK48, bt subsystem status, remove LPM.
* HAL: add missing api_hal_bt_is_alive symbol
* TODO about valuemutex
* duplicate f3-1 (f4) ioc from f3
* regenerate project
* use target dir for ble glue path
* update f4 from f3

Co-authored-by: coreglitch <mail@s3f.ru>
2020-12-10 17:25:20 +03:00
aanper
162418f7e3 add ld file 2020-12-08 13:18:35 +03:00
coreglitch
61cce74291
Fix OK button in F4 (#259)
* fix OK button in F4
* return DFU serial to make
2020-12-08 12:51:59 +03:00
あく
228055e4eb
OpenOCD makefile integration and Charger IC initialization fixes. (#258)
* Makefile: start openocd from gdb, boot no boot version.
* bq25896: reset before readout. Cleanup.
2020-12-04 20:30:50 +03:00
coreglitch
884dba647a
FL-409 Boot0 OK button (#257)
* update makefiles for f3-1
* add f3-1 files
* fix mk for f3
* remap OK button
* differ gpio invert
* expose full duplex spi2
* remove duplicate bq drivers
* remove bq inc
2020-12-02 16:40:06 +03:00
あく
3a6fbff8c3
FL-339: cli diagnostic interface for power subsystem. (#256)
* Core, API: add externs for c++
* Makefile: improve debug speed, flash with openocd, cleanup f2 config
* Power: add cli diagnostic.
* Local: fix api hal externs
* Local: fix externs in main and flipper_hal
* F2: power state dump stabs
* Bootloader flashing with openocd
* F3: move bq drivers to libs
* temporary do not build drivers on local
* temporary do not build drivers on f2

Co-authored-by: aanper <mail@s3f.ru>
2020-12-02 13:47:13 +03:00
coreglitch
f58b322bb5
FL-353 Cc1101 rx (#255)
* enable transparent mode
* rssi ok, transmit ok, fifo ok
* I see the signal
* successful async rx (registers from smartrf)
* refactor rfstudio register config
* rewrite config, found some issues
* handle G0 interrupts
* g0 irq enable after cc1101 init
* update cube
2020-12-01 21:47:46 +03:00
DrZlo13
1f761d7fbb
[FL-84] iButton app, dallas emulate + cyfral read, cyfral emulate (#253)
* maxim crc function
* one wire template device and ds1990 classes
* 3 fields for addr
* cyfral emulator lib
* add cyfral read mode, refract rendering and events
* add ADC1_IN14, add adc interrupt
* cyfral read mode
* rename and move api-hal includes folder
* build onewire libs only if we build app
* start in mode 0
2020-11-25 10:25:13 +03:00
あく
758e37e294
Enable RTC for all platforms and add cli date command (#252)
* F2: enable RTC. Cli: add date command.
2020-11-23 16:26:19 +03:00
あく
e348990fc6
Debug: Add PyCortexDebug. Core and peripheral register database and decoder. (#251)
* Debug: pycortexdebug
* Debug: format PyCortexMDebug source code
2020-11-19 18:48:34 +03:00
DrZlo13
a96f23af9b
fix multithread logic in template app, update gpio HAL (#250)
* fix multithread logic
* more buffer for dallas id string
* update apps to use new logic
* delay_us small speedup
* add consant qualifier to gpio records and some core api
* fix some apps to use simpler method of getting gpio record
* fix ibutton app, stupid stack problem
2020-11-19 15:25:32 +03:00
coreglitch
ccd40497eb
FL-176 LF RFID RX (#248)
* pulldown ibutton pin during rfid read
* enable and handle COMP interrupts
* send events from comparator IRQ and handle in app
* manchester encode
* successfully read em4100
* read-emulate
* led
2020-11-19 14:11:03 +03:00
DrZlo13
27ae2a8fa9
#FL-303 fix for some spi bugs, test app for sd-nfc interconnection (#247)
* sd-nfc test app

* do not hold spi in disable mode

* disable pullups in nfc chip
2020-11-18 16:01:25 +03:00
あく
d57b7fd448
Cli: fix memleak, add more commands. (#244)
* Cli: add statndard applications, fix memory leak, add reset and reset to dfu.

* Lib: pass proper data pointer to osMessageQueueGet

* App-loader: optional cli

* Format sources
2020-11-17 20:08:31 +03:00
DrZlo13
1abc98086e split resources, fix format 2020-11-17 07:39:48 +10:00
coreglitch
3d5563b169
init nfc later (#239) 2020-11-16 18:26:34 +03:00
あく
3749eb0eed
USB VCP Cli (#237)
* Core: ring buffer.
* Api: usb vcp. F3: vcp glue code.
* Applications: cli draft version.
* Cli: basic working version, includes help and version commands
* HAL: vcp on f2
* Makefile: update openocd conf
* F3: vcp rx with freertos stream
* Cli: help
* Cli: standard commands, api-hal-uid
* Power: cli poweroff.
2020-11-16 13:16:34 +03:00
DrZlo13
714d732745
FL-78 Microsd test application (#230)
* variable cluster size, label info functions for targets
* app record
* init, mount, get label, get sn, get space
* enable exfat
* more stack for the stack god
* remove c app and add cpp app
* remove MULTI_PARTITION
* fix 4gb bug
* update app to new template lib, add animated waiting
* tiny buffer configuration
* write speed benchmark
* fnv1a hash library
* make DEFAULT_STACK_SIZE and MAX_TASK_COUNT defined per target
* fully functional sd card app
* build sd test app to release firmware
* cpp, not c
* light up red led if error
* flags for c++
* linking with g++
* suppres snprintf warning
* move format work area to heap

Co-authored-by: coreglitch <mail@s3f.ru>
2020-11-14 19:24:38 +03:00
coreglitch
a61eef0f99
FL-186 Add vibro demo (#234)
* add vibro demo
* add F2 support
2020-11-12 22:26:49 +03:00
DrZlo13
9d8c36810e
IR RX simple app (#218)
* split falling and rising ir rx events
* fix irda
* simple irda rx function for app
* add extern timer
* fix timer num for f2
2020-11-11 10:36:27 +03:00
あく
f05ffddbde
Power: bq25896 and bq27220 drivers, portable power api. (#224)
* Power: add portability layer, port to F3.
* F3: bq25896 driver stab
* GUI: new primary and secondary fonts
* F3: bq25896 register map, basic functions
* F3: move bq27220 command descritpion to separate file. Code format.
* Power: OTG enable/disable
* Power: choose more correct profile
* F3: pet bq25896 watchdog sometimes
2020-11-11 09:31:35 +03:00
DrZlo13
49fdb28871
sd detect pin feature (#222)
* test sd detect pin
* sd detect support for f2 board
2020-11-11 09:17:53 +03:00
あく
76e3fd3060
Firmware, Bootloader: add f3 target. (#215)
* Firmware, Bootloader: add f3 target. Refactor code to be portable across targets.
* Firmware: remove bkpt
* Makefile: debug agent. Debug: f3 platform throw openocd.
* freertos-openocd helper
* separate hal resources
* return of input_dump app
* using hew target resources abstration layer for backlight and blink
* dirty hack for input driver, f3 has no charging pin
* worked input interrupts
* working display
* F3: switch to 32mHz resonator
* F3: configure SD_CS pin
* NFC: port to F3.
* fat uart app
* sd card hal api
* separate CC1101 spi config
* faster spi gpio for sd card
* Assets: disable LFS
* Cube: disable css on LSE
* Input: format code
* Make: add bootloader source code to formatting rule
* F3: enable rf by default, adjust clock settings, map all pins where they should be.
* libs for coreglitch_demo_0
* nvic priority
* bus clocks all to 64
* lf-rfid timer and pin
* irda
* ir rx setup
* tim2 irq handler
* Makefile: environment aware mkdir
* Makefile, Irukagotchi: commit seq number.
* split falling and rising ir rx events
* Makefile: proper git branch detect on old git. Firmware: api fix.
* fix irda
* Makefile,Irukagotchi: date timestamp.
* NFC: adjust SPI speed
* Irukagotchi: format code
* Make: add blackmagic debug in host mode
* Makefile: detach blackmagic from terminal signals
* Makefile,Irukagotchi: stamp target
* add F3 bootloader/firmware to CI

Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
Co-authored-by: aanper <mail@s3f.ru>
2020-11-06 13:52:50 +03:00
coreglitch
bce6f867f1
show target version, date, commit hash and branch (#221) 2020-11-06 12:31:06 +03:00
coreglitch
eb2679b982
Refactor F2/local before F3 merge (#220)
* add files from f3
* rollback lfs
* Move assets from LFS
* remove lfs from build

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2020-11-06 11:31:59 +03:00
DrZlo13
979af6c165
Core code cleanup (#206)
* add delay function
* todo about delay_isr
* remove arduino defines and fix all apps to use core-api/hal-api
* delay for local target
* remove warnings of task_equal
* fix BSP_SD_Init
* fix USBD_static
* grio read constant pointer to gpio
* add TODO about ISR context
* const void* arg for pubsub api
* mark unused functions
* app pointers now pointed to constant apps
* fix printf format
* fix "unused" warnings in local target
* fix const pin read in local target
* fix int to pointer warnings in local target
* power read mutex error fix
* delete old makefile
* add -werror

Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
Co-authored-by: aanper <mail@s3f.ru>
2020-10-29 10:58:19 +03:00
DrZlo13
8aeafd8179
furi_check - a new way to asserting (#204)
* hal-related task_is_isr_context function
* furi_check implementation
* change application to use furi_check
* add second level of assertion
* add TODO about ISR context
* Applications: refactor furi_check and furi_assert.
* Apploader: propwer widget usage. Menu: check on furi resource request.
* refactor furi_check

Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
Co-authored-by: coreglitch <mail@s3f.ru>
2020-10-29 09:27:17 +03:00
DrZlo13
c9b921f6ce
added openocd support (#211)
openocd needs a visible uxTopUsedPriority symbol for freertos, but freertos is discarding it in v7, so I add the helper file manually
2020-10-29 08:41:44 +03:00
あく
665f6d7d9c
Assets, Icons, UI toolkit. Part 1. (#202)
* Assets: import from gdrive
* Assets: fully working build pipeline and registry
* NFC: menu icon
* Gui: layers. Irukagotchi: base app to handle input on idle screen. Makefile: reboot after flash in dfu mode.
* ValueMutex: with lambda
* Assets: proper animation frames sorting
* ValueMutex: proper furi_open usage
* Assets,GUI: split icon into icon data and icon state.
* Format source code
* Docker: add python3 and imagemagic
* Irukagotchi: cleanup
* GUI: event lock moved to gui.
* Rfid: proper gui layer
* GUI: elements. Menu: frame and scroll
* GUI, Menu: format code.
* Menu: dual font main menu
* Menu: format sources
* GUI: 0 total scrollbar
* CI: enable lfs
* Menu: pixel perfect main menu

Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
Co-authored-by: aanper <mail@s3f.ru>
2020-10-26 20:00:17 +03:00