correct isr context for nrf DCD_EVENT_UNPLUGGED
also rename debug lookup to prevent conflict
This commit is contained in:
		| @@ -105,7 +105,7 @@ static inline uint16_t rdwr10_get_blockcount(uint8_t const command[]) | |||||||
| //--------------------------------------------------------------------+ | //--------------------------------------------------------------------+ | ||||||
| #if CFG_TUSB_DEBUG >= 2 | #if CFG_TUSB_DEBUG >= 2 | ||||||
|  |  | ||||||
| static lookup_entry_t const _msc_scsi_cmd_lookup[] = | static tu_lookup_entry_t const _msc_scsi_cmd_lookup[] = | ||||||
| { | { | ||||||
|   { .key = SCSI_CMD_TEST_UNIT_READY              , .data = "Test Unit Ready" }, |   { .key = SCSI_CMD_TEST_UNIT_READY              , .data = "Test Unit Ready" }, | ||||||
|   { .key = SCSI_CMD_INQUIRY                      , .data = "Inquiry" }, |   { .key = SCSI_CMD_INQUIRY                      , .data = "Inquiry" }, | ||||||
| @@ -120,7 +120,7 @@ static lookup_entry_t const _msc_scsi_cmd_lookup[] = | |||||||
|   { .key = SCSI_CMD_WRITE_10                     , .data = "Write10" } |   { .key = SCSI_CMD_WRITE_10                     , .data = "Write10" } | ||||||
| }; | }; | ||||||
|  |  | ||||||
| static lookup_table_t const _msc_scsi_cmd_table = | static tu_lookup_table_t const _msc_scsi_cmd_table = | ||||||
| { | { | ||||||
|   .count = TU_ARRAY_SIZE(_msc_scsi_cmd_lookup), |   .count = TU_ARRAY_SIZE(_msc_scsi_cmd_lookup), | ||||||
|   .items = _msc_scsi_cmd_lookup |   .items = _msc_scsi_cmd_lookup | ||||||
| @@ -418,7 +418,7 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t | |||||||
|       TU_ASSERT( event == XFER_RESULT_SUCCESS && |       TU_ASSERT( event == XFER_RESULT_SUCCESS && | ||||||
|                  xferred_bytes == sizeof(msc_cbw_t) && p_cbw->signature == MSC_CBW_SIGNATURE ); |                  xferred_bytes == sizeof(msc_cbw_t) && p_cbw->signature == MSC_CBW_SIGNATURE ); | ||||||
|  |  | ||||||
|       TU_LOG2("  SCSI Command: %s\r\n", lookup_find(&_msc_scsi_cmd_table, p_cbw->command[0])); |       TU_LOG2("  SCSI Command: %s\r\n", tu_lookup_find(&_msc_scsi_cmd_table, p_cbw->command[0])); | ||||||
|       // TU_LOG2_MEM(p_cbw, xferred_bytes, 2); |       // TU_LOG2_MEM(p_cbw, xferred_bytes, 2); | ||||||
|  |  | ||||||
|       p_csw->signature    = MSC_CSW_SIGNATURE; |       p_csw->signature    = MSC_CSW_SIGNATURE; | ||||||
|   | |||||||
| @@ -251,16 +251,16 @@ void tu_print_var(uint8_t const* buf, uint32_t bufsize) | |||||||
| typedef struct | typedef struct | ||||||
| { | { | ||||||
|   uint32_t key; |   uint32_t key; | ||||||
|   char const * data; |   const char* data; | ||||||
| }lookup_entry_t; | } tu_lookup_entry_t; | ||||||
|  |  | ||||||
| typedef struct | typedef struct | ||||||
| { | { | ||||||
|   uint16_t count; |   uint16_t count; | ||||||
|   lookup_entry_t const* items; |   tu_lookup_entry_t const* items; | ||||||
| } lookup_table_t; | } tu_lookup_table_t; | ||||||
|  |  | ||||||
| static inline char const* lookup_find(lookup_table_t const* p_table, uint32_t key) | static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key) | ||||||
| { | { | ||||||
|   for(uint16_t i=0; i<p_table->count; i++) |   for(uint16_t i=0; i<p_table->count; i++) | ||||||
|   { |   { | ||||||
|   | |||||||
| @@ -829,7 +829,7 @@ void tusb_hal_nrf_power_event (uint32_t event) | |||||||
|  |  | ||||||
|         hfclk_disable(); |         hfclk_disable(); | ||||||
|  |  | ||||||
|         dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, true); |         dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) ? true : false); | ||||||
|       } |       } | ||||||
|     break; |     break; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach