Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed qnode2 MFRC522-2 eeprom Buffer2
Revision 2:ed78589d626a, committed 2018-07-28
- Comitter:
- alejo5214416
- Date:
- Sat Jul 28 01:34:57 2018 +0000
- Parent:
- 1:4235920f89f8
- Child:
- 3:5d963b3e042f
- Commit message:
- Memoria con interrupcion, escritura y lectura ok.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Jul 27 02:49:21 2018 +0000 +++ b/main.cpp Sat Jul 28 01:34:57 2018 +0000 @@ -77,66 +77,23 @@ disp_uno.attach(&disp_unoRx_isr,Serial::RxIrq); disp_uno.attach(&disp_unoTx_isr,Serial::TxIrq); led4=1; - while(1){ - while(flag4==true){ - if(!RfChip.PICC_IsNewCardPresent()) - continue; - if (!RfChip.PICC_ReadCardSerial()) - continue; - pc.printf("Tarjeta Numero: "); - uint8_t *c = &RfChip.uid.uidByte[0]; - enQueue(q,c); - ret = write_data(eepr_addr, address,c); - pc.printf("\n"); - for(int j=0; j<4; j++) { - uint8_t car = data_read(eepr_addr, (0x0001+j)); - pc.printf("%X",car); + while(1) { + while(flag4==true) { + if(!RfChip.PICC_IsNewCardPresent()) + continue; + if (!RfChip.PICC_ReadCardSerial()) + continue; + pc.printf("Tarjeta Numero: "); + uint8_t *c = &RfChip.uid.uidByte[0]; + enQueue(q,c); + write_data(eepr_addr, address,c); + pc.printf("\n"); + for(int j=0; j<4; j++) { + uint8_t car = data_read(eepr_addr, (0x0001+j)); + pc.printf("%X",car); + } + pc.printf("\n"); + flag4=false; } - flag4=false; - } -} - + } } - -/* - led2 = !led2; - if ( RfChip.PICC_IsNewCardPresent()) { - led_3=0; - if (RfChip.PICC_ReadCardSerial()) { - - LedGreen = 1; - pc.printf("Tarjeta Numero: "); - uint8_t * c = &RfChip.uid.uidByte[0]; - enQueue(q,c); - pc.printf("\n\r"); - wait_ms(200); - } - } -*/ - - - -if(flag1==true) -{ - QNode *c= deQueue(q); - enable=1; - for(int i=0; i<4; i++) { - disp_uno.printf("%02X ",c->uid[i]); - } - enable=1; - disp_uno.putc('\n'); - flag1=false; -} else if(flag2==true) -{ - //enable=1; - pc.printf("YES\n"); - flag2=false; -} else if(flag3==true) -{ - //enable=1; - pc.printf("NO\n"); - flag3=false; -} -} -} -}