Scott Lahteine 7 лет назад
Родитель
Сommit
8b12371e45

+ 5
- 5
Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp Просмотреть файл

@@ -97,7 +97,7 @@ void spiBegin (void) {
97 97
   //------------------------------------------------------------------------------
98 98
   /** SPI receive a byte */
99 99
   uint8_t spiRec(void) {
100
-    SPDR = 0XFF;
100
+    SPDR = 0xFF;
101 101
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
102 102
     return SPDR;
103 103
   }
@@ -105,11 +105,11 @@ void spiBegin (void) {
105 105
   /** SPI read data  */
106 106
   void spiRead(uint8_t* buf, uint16_t nbyte) {
107 107
     if (nbyte-- == 0) return;
108
-    SPDR = 0XFF;
108
+    SPDR = 0xFF;
109 109
     for (uint16_t i = 0; i < nbyte; i++) {
110 110
       while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
111 111
       buf[i] = SPDR;
112
-      SPDR = 0XFF;
112
+      SPDR = 0xFF;
113 113
     }
114 114
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
115 115
     buf[nbyte] = SPDR;
@@ -150,7 +150,7 @@ void spiBegin (void) {
150 150
     uint8_t data = 0;
151 151
     // no interrupts during byte receive - about 8 us
152 152
     cli();
153
-    // output pin high - like sending 0XFF
153
+    // output pin high - like sending 0xFF
154 154
     WRITE(MOSI_PIN, HIGH);
155 155
 
156 156
     for (uint8_t i = 0; i < 8; i++) {
@@ -184,7 +184,7 @@ void spiBegin (void) {
184 184
     for (uint8_t i = 0; i < 8; i++) {
185 185
       WRITE(SCK_PIN, LOW);
186 186
 
187
-      WRITE(MOSI_PIN, data & 0X80);
187
+      WRITE(MOSI_PIN, data & 0x80);
188 188
 
189 189
       data <<= 1;
190 190
 

+ 3
- 3
Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp Просмотреть файл

@@ -56,7 +56,7 @@ uint8_t spiRec(void) {
56 56
   uint8_t returnByte = SPI.transfer(0xFF);
57 57
   SPI.endTransaction();
58 58
   return returnByte;
59
-//  SPDR = 0XFF;
59
+//  SPDR = 0xFF;
60 60
 //  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
61 61
 //  return SPDR;
62 62
 }
@@ -67,11 +67,11 @@ void spiRead(uint8_t* buf, uint16_t nbyte) {
67 67
   SPI.transfer(buf, nbyte);
68 68
   SPI.endTransaction();
69 69
 //if (nbyte-- == 0) return;
70
-//  SPDR = 0XFF;
70
+//  SPDR = 0xFF;
71 71
 //for (uint16_t i = 0; i < nbyte; i++) {
72 72
 //  while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
73 73
 //  buf[i] = SPDR;
74
-//  SPDR = 0XFF;
74
+//  SPDR = 0xFF;
75 75
 //}
76 76
 //while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
77 77
 //buf[nbyte] = SPDR;

+ 4
- 4
Marlin/src/sd/Sd2Card.cpp Просмотреть файл

@@ -342,7 +342,7 @@ bool Sd2Card::readData(uint8_t* dst) {
342 342
 bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
343 343
   // wait for start block token
344 344
   uint16_t t0 = millis();
345
-  while ((status_ = spiRec()) == 0XFF) {
345
+  while ((status_ = spiRec()) == 0xFF) {
346 346
     if (((uint16_t)millis() - t0) > SD_READ_TIMEOUT) {
347 347
       error(SD_CARD_ERROR_READ_TIMEOUT);
348 348
       goto FAIL;
@@ -372,12 +372,12 @@ bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
372 372
 #endif
373 373
   chipSelectHigh();
374 374
   // Send an additional dummy byte, required by Toshiba Flash Air SD Card
375
-  spiSend(0XFF);
375
+  spiSend(0xFF);
376 376
   return true;
377 377
   FAIL:
378 378
   chipSelectHigh();
379 379
   // Send an additional dummy byte, required by Toshiba Flash Air SD Card
380
-  spiSend(0XFF);
380
+  spiSend(0xFF);
381 381
   return false;
382 382
 }
383 383
 
@@ -453,7 +453,7 @@ bool Sd2Card::setSckRate(uint8_t sckRateID) {
453 453
 // wait for card to go not busy
454 454
 bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) {
455 455
   uint16_t t0 = millis();
456
-  while (spiRec() != 0XFF)
456
+  while (spiRec() != 0xFF)
457 457
     if (((uint16_t)millis() - t0) >= timeoutMillis) return false;
458 458
 
459 459
   return true;

+ 15
- 15
Marlin/src/sd/Sd2Card.h Просмотреть файл

@@ -46,21 +46,21 @@ uint16_t const SD_INIT_TIMEOUT = 2000,    // init timeout ms
46 46
                SD_WRITE_TIMEOUT = 600;    // write time out ms
47 47
 
48 48
 // SD card errors
49
-uint8_t const SD_CARD_ERROR_CMD0 = 0X1,                 // timeout error for command CMD0 (initialize card in SPI mode)
50
-              SD_CARD_ERROR_CMD8 = 0X2,                 // CMD8 was not accepted - not a valid SD card
51
-              SD_CARD_ERROR_CMD12 = 0X3,                // card returned an error response for CMD12 (write stop)
52
-              SD_CARD_ERROR_CMD17 = 0X4,                // card returned an error response for CMD17 (read block)
53
-              SD_CARD_ERROR_CMD18 = 0X5,                // card returned an error response for CMD18 (read multiple block)
54
-              SD_CARD_ERROR_CMD24 = 0X6,                // card returned an error response for CMD24 (write block)
55
-              SD_CARD_ERROR_CMD25 = 0X7,                // WRITE_MULTIPLE_BLOCKS command failed
56
-              SD_CARD_ERROR_CMD58 = 0X8,                // card returned an error response for CMD58 (read OCR)
57
-              SD_CARD_ERROR_ACMD23 = 0X9,               // SET_WR_BLK_ERASE_COUNT failed
58
-              SD_CARD_ERROR_ACMD41 = 0XA,               // ACMD41 initialization process timeout
59
-              SD_CARD_ERROR_BAD_CSD = 0XB,              // card returned a bad CSR version field
60
-              SD_CARD_ERROR_ERASE = 0XC,                // erase block group command failed
61
-              SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD,   // card not capable of single block erase
62
-              SD_CARD_ERROR_ERASE_TIMEOUT = 0XE,        // Erase sequence timed out
63
-              SD_CARD_ERROR_READ = 0XF,                 // card returned an error token instead of read data
49
+uint8_t const SD_CARD_ERROR_CMD0 = 0x01,                // timeout error for command CMD0 (initialize card in SPI mode)
50
+              SD_CARD_ERROR_CMD8 = 0x02,                // CMD8 was not accepted - not a valid SD card
51
+              SD_CARD_ERROR_CMD12 = 0x03,               // card returned an error response for CMD12 (write stop)
52
+              SD_CARD_ERROR_CMD17 = 0x04,               // card returned an error response for CMD17 (read block)
53
+              SD_CARD_ERROR_CMD18 = 0x05,               // card returned an error response for CMD18 (read multiple block)
54
+              SD_CARD_ERROR_CMD24 = 0x06,               // card returned an error response for CMD24 (write block)
55
+              SD_CARD_ERROR_CMD25 = 0x07,               // WRITE_MULTIPLE_BLOCKS command failed
56
+              SD_CARD_ERROR_CMD58 = 0x08,               // card returned an error response for CMD58 (read OCR)
57
+              SD_CARD_ERROR_ACMD23 = 0x09,              // SET_WR_BLK_ERASE_COUNT failed
58
+              SD_CARD_ERROR_ACMD41 = 0x0A,              // ACMD41 initialization process timeout
59
+              SD_CARD_ERROR_BAD_CSD = 0x0B,             // card returned a bad CSR version field
60
+              SD_CARD_ERROR_ERASE = 0x0C,               // erase block group command failed
61
+              SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0x0D,  // card not capable of single block erase
62
+              SD_CARD_ERROR_ERASE_TIMEOUT = 0x0E,       // Erase sequence timed out
63
+              SD_CARD_ERROR_READ = 0x0F,                // card returned an error token instead of read data
64 64
               SD_CARD_ERROR_READ_REG = 0x10,            // read CID or CSD failed
65 65
               SD_CARD_ERROR_READ_TIMEOUT = 0x11,        // timeout while waiting for start of read data
66 66
               SD_CARD_ERROR_STOP_TRAN = 0x12,           // card did not accept STOP_TRAN_TOKEN

+ 4
- 4
Marlin/src/sd/SdBaseFile.cpp Просмотреть файл

@@ -601,7 +601,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t ofla
601 601
   // search for file
602 602
 
603 603
   while (dirFile->curPosition_ < dirFile->fileSize_) {
604
-    index = 0XF & (dirFile->curPosition_ >> 5);
604
+    index = 0xF & (dirFile->curPosition_ >> 5);
605 605
     p = dirFile->readDirCache();
606 606
     if (!p) return false;
607 607
 
@@ -705,7 +705,7 @@ bool SdBaseFile::open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag) {
705 705
     return false;
706 706
   }
707 707
   // open cached entry
708
-  return openCachedEntry(index & 0XF, oflag);
708
+  return openCachedEntry(index & 0xF, oflag);
709 709
 }
710 710
 
711 711
 // open a cached directory entry. Assumes vol_ is initialized
@@ -775,7 +775,7 @@ bool SdBaseFile::openNext(SdBaseFile* dirFile, uint8_t oflag) {
775 775
   vol_ = dirFile->vol_;
776 776
 
777 777
   while (1) {
778
-    index = 0XF & (dirFile->curPosition_ >> 5);
778
+    index = 0xF & (dirFile->curPosition_ >> 5);
779 779
 
780 780
     // read entry into cache
781 781
     p = dirFile->readDirCache();
@@ -1100,7 +1100,7 @@ dir_t* SdBaseFile::readDirCache() {
1100 1100
   if (!isDir()) return 0;
1101 1101
 
1102 1102
   // index of entry in cache
1103
-  i = (curPosition_ >> 5) & 0XF;
1103
+  i = (curPosition_ >> 5) & 0xF;
1104 1104
 
1105 1105
   // use read to locate and cache block
1106 1106
   if (read() < 0) return 0;

+ 1
- 1
Marlin/src/sd/SdVolume.cpp Просмотреть файл

@@ -207,7 +207,7 @@ bool SdVolume::fatPut(uint32_t cluster, uint32_t value) {
207 207
     index &= 0x1FF;
208 208
     uint8_t tmp = value;
209 209
     if (cluster & 1) {
210
-      tmp = (cacheBuffer_.data[index] & 0XF) | tmp << 4;
210
+      tmp = (cacheBuffer_.data[index] & 0xF) | tmp << 4;
211 211
     }
212 212
     cacheBuffer_.data[index] = tmp;
213 213
     index++;

Загрузка…
Отмена
Сохранить