NFC: rename to Nfc
This commit is contained in:
		
							parent
							
								
									c124471d44
								
							
						
					
					
						commit
						ecc93152c9
					
				| @ -19,14 +19,14 @@ | |||||||
| 
 | 
 | ||||||
| typedef enum { | typedef enum { | ||||||
|     MessageTypeBase, |     MessageTypeBase, | ||||||
| } NFCMessageType; | } NfcMessageType; | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|     Message base; |     Message base; | ||||||
|     void* data; |     void* data; | ||||||
| } NFCMessage; | } NfcMessage; | ||||||
| 
 | 
 | ||||||
| struct NFC { | struct Nfc { | ||||||
|     Dispatcher* dispatcher; |     Dispatcher* dispatcher; | ||||||
|     Widget* widget; |     Widget* widget; | ||||||
|     MenuItem* menu; |     MenuItem* menu; | ||||||
| @ -45,7 +45,7 @@ struct NFC { | |||||||
| #define EXAMPLE_NFCA_DEVICES 5 | #define EXAMPLE_NFCA_DEVICES 5 | ||||||
| 
 | 
 | ||||||
| void nfc_worker_task(void* context) { | void nfc_worker_task(void* context) { | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
|     ReturnCode err; |     ReturnCode err; | ||||||
|     rfalNfcaSensRes sensRes; |     rfalNfcaSensRes sensRes; | ||||||
|     rfalNfcaSelRes selRes; |     rfalNfcaSelRes selRes; | ||||||
| @ -135,7 +135,7 @@ void nfc_worker_task(void* context) { | |||||||
| 
 | 
 | ||||||
| void nfc_draw_callback(CanvasApi* canvas, void* context) { | void nfc_draw_callback(CanvasApi* canvas, void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
| 
 | 
 | ||||||
|     dispatcher_lock(nfc->dispatcher); |     dispatcher_lock(nfc->dispatcher); | ||||||
|     canvas->clear(canvas); |     canvas->clear(canvas); | ||||||
| @ -153,7 +153,7 @@ void nfc_draw_callback(CanvasApi* canvas, void* context) { | |||||||
| 
 | 
 | ||||||
| void nfc_input_callback(InputEvent* event, void* context) { | void nfc_input_callback(InputEvent* event, void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
| 
 | 
 | ||||||
|     if(!event->state) return; |     if(!event->state) return; | ||||||
| 
 | 
 | ||||||
| @ -162,7 +162,7 @@ void nfc_input_callback(InputEvent* event, void* context) { | |||||||
| 
 | 
 | ||||||
| void nfc_test_callback(void* context) { | void nfc_test_callback(void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
| 
 | 
 | ||||||
|     dispatcher_lock(nfc->dispatcher); |     dispatcher_lock(nfc->dispatcher); | ||||||
| 
 | 
 | ||||||
| @ -176,27 +176,27 @@ void nfc_test_callback(void* context) { | |||||||
| 
 | 
 | ||||||
| void nfc_read_callback(void* context) { | void nfc_read_callback(void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
|     (void)nfc; |     (void)nfc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void nfc_write_callback(void* context) { | void nfc_write_callback(void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
|     (void)nfc; |     (void)nfc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void nfc_bridge_callback(void* context) { | void nfc_bridge_callback(void* context) { | ||||||
|     assert(context); |     assert(context); | ||||||
|     NFC* nfc = context; |     Nfc* nfc = context; | ||||||
|     (void)nfc; |     (void)nfc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| NFC* nfc_alloc() { | Nfc* nfc_alloc() { | ||||||
|     NFC* nfc = furi_alloc(sizeof(NFC)); |     Nfc* nfc = furi_alloc(sizeof(Nfc)); | ||||||
|     assert(nfc); |     assert(nfc); | ||||||
| 
 | 
 | ||||||
|     nfc->dispatcher = dispatcher_alloc(32, sizeof(NFCMessage)); |     nfc->dispatcher = dispatcher_alloc(32, sizeof(NfcMessage)); | ||||||
| 
 | 
 | ||||||
|     nfc->widget = widget_alloc(); |     nfc->widget = widget_alloc(); | ||||||
|     widget_draw_callback_set(nfc->widget, nfc_draw_callback, nfc); |     widget_draw_callback_set(nfc->widget, nfc_draw_callback, nfc); | ||||||
| @ -225,7 +225,7 @@ NFC* nfc_alloc() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void nfc_task(void* p) { | void nfc_task(void* p) { | ||||||
|     NFC* nfc = nfc_alloc(); |     Nfc* nfc = nfc_alloc(); | ||||||
| 
 | 
 | ||||||
|     GuiApi* gui = furi_take(nfc->gui_record); |     GuiApi* gui = furi_take(nfc->gui_record); | ||||||
|     assert(gui); |     assert(gui); | ||||||
| @ -248,7 +248,7 @@ void nfc_task(void* p) { | |||||||
|     nfc->ret = rfalNfcInitialize(); |     nfc->ret = rfalNfcInitialize(); | ||||||
|     rfalLowPowerModeStart(); |     rfalLowPowerModeStart(); | ||||||
| 
 | 
 | ||||||
|     NFCMessage message; |     NfcMessage message; | ||||||
|     while(1) { |     while(1) { | ||||||
|         dispatcher_recieve(nfc->dispatcher, (Message*)&message); |         dispatcher_recieve(nfc->dispatcher, (Message*)&message); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| typedef struct NFC NFC; | typedef struct Nfc Nfc; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Aleksandr Kutuzov
						Aleksandr Kutuzov