Hiroh Satoh / keyboard Featured

Dependencies:   BLE_API mbed-dev nRF51822

Revision:
17:3233ee19f716
Parent:
16:345eebc4f259
Child:
20:d8840ac38434
--- a/main.cpp	Mon Aug 22 12:28:47 2016 +0000
+++ b/main.cpp	Mon Aug 22 12:58:29 2016 +0000
@@ -265,7 +265,7 @@
 	HIDController::init();
 		
 	// STOP UART RX for power consumption
-	NRF_UART0->TASKS_STOPRX = 1;
+	// NRF_UART0->TASKS_STOPRX = 1;
 	
 	NRF_TWI0->ENABLE = TWI_ENABLE_ENABLE_Disabled << TWI_ENABLE_ENABLE_Pos;
 				
@@ -299,6 +299,7 @@
 		} else {
 			printf("wait for events...\r\n");
 			
+			/* save 50uA
 			while (NRF_UART0->EVENTS_TXDRDY != 1);
 			
 			uint32_t tx = NRF_UART0->PSELTXD;
@@ -306,10 +307,11 @@
 			NRF_UART0->TASKS_STOPTX = 1;
 			NRF_UART0->TASKS_STOPRX = 1;
 			NRF_UART0->ENABLE = (UART_ENABLE_ENABLE_Disabled << UART_ENABLE_ENABLE_Pos);
-					
+			*/
 
 			HIDController::waitForEvent();
 			
+			/*
 			NRF_UART0->ENABLE = (UART_ENABLE_ENABLE_Enabled << UART_ENABLE_ENABLE_Pos);
 			NRF_UART0->TASKS_STARTTX = 1;
 			NRF_UART0->PSELTXD = 0xFFFFFFFF;
@@ -317,7 +319,7 @@
 		    NRF_UART0->TXD = 0;
 		    while (NRF_UART0->EVENTS_TXDRDY != 1);
 			NRF_UART0->PSELTXD = tx;
-
+			*/
 		}
 	}
 }