Browse Source

Nybbles & Bits

Scott Lahteine 3 years ago
parent
commit
49564e5310

+ 12
- 12
Marlin/src/libs/W25Qxx.cpp View File

@@ -191,11 +191,11 @@ void W25QXXFlash::SPI_FLASH_SectorErase(uint32_t SectorAddr) {
191 191
   W25QXX_CS_L;
192 192
   // Send Sector Erase instruction
193 193
   spi_flash_Send(W25X_SectorErase);
194
-  // Send SectorAddr high nibble address byte
194
+  // Send SectorAddr high nybble address byte
195 195
   spi_flash_Send((SectorAddr & 0xFF0000) >> 16);
196
-  // Send SectorAddr medium nibble address byte
196
+  // Send SectorAddr medium nybble address byte
197 197
   spi_flash_Send((SectorAddr & 0xFF00) >> 8);
198
-  // Send SectorAddr low nibble address byte
198
+  // Send SectorAddr low nybble address byte
199 199
   spi_flash_Send(SectorAddr & 0xFF);
200 200
   // Deselect the FLASH: Chip Select high
201 201
 
@@ -209,11 +209,11 @@ void W25QXXFlash::SPI_FLASH_BlockErase(uint32_t BlockAddr) {
209 209
   W25QXX_CS_L;
210 210
   // Send Sector Erase instruction
211 211
   spi_flash_Send(W25X_BlockErase);
212
-  // Send SectorAddr high nibble address byte
212
+  // Send SectorAddr high nybble address byte
213 213
   spi_flash_Send((BlockAddr & 0xFF0000) >> 16);
214
-  // Send SectorAddr medium nibble address byte
214
+  // Send SectorAddr medium nybble address byte
215 215
   spi_flash_Send((BlockAddr & 0xFF00) >> 8);
216
-  // Send SectorAddr low nibble address byte
216
+  // Send SectorAddr low nybble address byte
217 217
   spi_flash_Send(BlockAddr & 0xFF);
218 218
 
219 219
   W25QXX_CS_H;
@@ -265,11 +265,11 @@ void W25QXXFlash::SPI_FLASH_PageWrite(uint8_t* pBuffer, uint32_t WriteAddr, uint
265 265
   W25QXX_CS_L;
266 266
   // Send "Write to Memory " instruction
267 267
   spi_flash_Send(W25X_PageProgram);
268
-  // Send WriteAddr high nibble address byte to write to
268
+  // Send WriteAddr high nybble address byte to write to
269 269
   spi_flash_Send((WriteAddr & 0xFF0000) >> 16);
270
-  // Send WriteAddr medium nibble address byte to write to
270
+  // Send WriteAddr medium nybble address byte to write to
271 271
   spi_flash_Send((WriteAddr & 0xFF00) >> 8);
272
-  // Send WriteAddr low nibble address byte to write to
272
+  // Send WriteAddr low nybble address byte to write to
273 273
   spi_flash_Send(WriteAddr & 0xFF);
274 274
 
275 275
   NOMORE(NumByteToWrite, SPI_FLASH_PerWritePageSize);
@@ -371,11 +371,11 @@ void W25QXXFlash::SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint
371 371
   // Send "Read from Memory " instruction
372 372
   spi_flash_Send(W25X_ReadData);
373 373
 
374
-  // Send ReadAddr high nibble address byte to read from
374
+  // Send ReadAddr high nybble address byte to read from
375 375
   spi_flash_Send((ReadAddr & 0xFF0000) >> 16);
376
-  // Send ReadAddr medium nibble address byte to read from
376
+  // Send ReadAddr medium nybble address byte to read from
377 377
   spi_flash_Send((ReadAddr & 0xFF00) >> 8);
378
-  // Send ReadAddr low nibble address byte to read from
378
+  // Send ReadAddr low nybble address byte to read from
379 379
   spi_flash_Send(ReadAddr & 0xFF);
380 380
 
381 381
   if (NumByteToRead <= 32 || !flash_dma_mode) {

+ 12
- 12
Marlin/src/module/planner.cpp View File

@@ -418,11 +418,11 @@ void Planner::init() {
418 418
         L("2")
419 419
         A("cpi %16,0x10")                 // (nr & 0xF00000) == 0 ?
420 420
         A("brcc 3f")                      // No, skip this
421
-        A("swap %15")                     // Swap nibbles
422
-        A("swap %16")                     // Swap nibbles. Low nibble is 0
421
+        A("swap %15")                     // Swap nybbles
422
+        A("swap %16")                     // Swap nybbles. Low nybble is 0
423 423
         A("mov %14, %15")
424
-        A("andi %14,0x0F")                // Isolate low nibble
425
-        A("andi %15,0xF0")                // Keep proper nibble in %15
424
+        A("andi %14,0x0F")                // Isolate low nybble
425
+        A("andi %15,0xF0")                // Keep proper nybble in %15
426 426
         A("or %16, %14")                  // %16:%15 <<= 4
427 427
         A("subi %3,-4")                   // idx += 4
428 428
 
@@ -473,10 +473,10 @@ void Planner::init() {
473 473
         L("9")
474 474
         A("sbrs %3,2")                    // shift by 4bits position?
475 475
         A("rjmp 16f")                     // No
476
-        A("swap %15")                     // Swap nibbles. lo nibble of %15 will always be 0
477
-        A("swap %14")                     // Swap nibbles
476
+        A("swap %15")                     // Swap nybbles. lo nybble of %15 will always be 0
477
+        A("swap %14")                     // Swap nybbles
478 478
         A("mov %12,%14")
479
-        A("andi %12,0x0F")                // isolate low nibble
479
+        A("andi %12,0x0F")                // isolate low nybble
480 480
         A("andi %14,0xF0")                // and clear it
481 481
         A("or %15,%12")                   // %15:%16 <<= 4
482 482
         L("16")
@@ -504,11 +504,11 @@ void Planner::init() {
504 504
         L("11")
505 505
         A("sbrs %3,2")                    // shift by 4 bit position ?
506 506
         A("rjmp 12f")                     // No, skip it
507
-        A("swap %15")                     // Swap nibbles
508
-        A("andi %14, 0xF0")               // Lose the lowest nibble
509
-        A("swap %14")                     // Swap nibbles. Upper nibble is 0
510
-        A("or %14,%15")                   // Pass nibble from upper byte
511
-        A("andi %15, 0x0F")               // And get rid of that nibble
507
+        A("swap %15")                     // Swap nybbles
508
+        A("andi %14, 0xF0")               // Lose the lowest nybble
509
+        A("swap %14")                     // Swap nybbles. Upper nybble is 0
510
+        A("or %14,%15")                   // Pass nybble from upper byte
511
+        A("andi %15, 0x0F")               // And get rid of that nybble
512 512
         L("12")
513 513
         A("sbrs %3,3")                    // shift by 8 bit position ?
514 514
         A("rjmp 6f")                      // No, skip it

+ 6
- 6
Marlin/src/sd/usb_flashdrive/lib-uhs2/printhex.h View File

@@ -32,12 +32,12 @@ void E_Notifyc(char c, int lvl);
32 32
 
33 33
 template <class T>
34 34
 void PrintHex(T val, int lvl) {
35
-  int num_nibbles = sizeof (T) * 2;
35
+  int num_nybbles = sizeof (T) * 2;
36 36
   do {
37
-    char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
37
+    char v = 48 + (((val >> (num_nybbles - 1) * 4)) & 0x0F);
38 38
     if (v > 57) v += 7;
39 39
     E_Notifyc(v, lvl);
40
-  } while (--num_nibbles);
40
+  } while (--num_nybbles);
41 41
 }
42 42
 
43 43
 template <class T>
@@ -48,12 +48,12 @@ void PrintBin(T val, int lvl) {
48 48
 
49 49
 template <class T>
50 50
 void SerialPrintHex(T val) {
51
-  int num_nibbles = sizeof (T) * 2;
51
+  int num_nybbles = sizeof (T) * 2;
52 52
   do {
53
-    char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
53
+    char v = 48 + (((val >> (num_nybbles - 1) * 4)) & 0x0F);
54 54
     if (v > 57) v += 7;
55 55
     USB_HOST_SERIAL.print(v);
56
-  } while (--num_nibbles);
56
+  } while (--num_nybbles);
57 57
 }
58 58
 
59 59
 template <class T>

+ 6
- 6
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h View File

@@ -33,13 +33,13 @@ void E_Notifyc(char c, int lvl);
33 33
 
34 34
 template <class T>
35 35
 void PrintHex(T val, int lvl) {
36
-        int num_nibbles = sizeof (T) * 2;
36
+        int num_nybbles = sizeof (T) * 2;
37 37
 
38 38
         do {
39
-                char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
39
+                char v = 48 + (((val >> (num_nybbles - 1) * 4)) & 0x0F);
40 40
                 if(v > 57) v += 7;
41 41
                 E_Notifyc(v, lvl);
42
-        } while(--num_nibbles);
42
+        } while(--num_nybbles);
43 43
 }
44 44
 
45 45
 template <class T>
@@ -53,13 +53,13 @@ void PrintBin(T val, int lvl) {
53 53
 
54 54
 template <class T>
55 55
 void SerialPrintHex(T val) {
56
-        int num_nibbles = sizeof (T) * 2;
56
+        int num_nybbles = sizeof (T) * 2;
57 57
 
58 58
         do {
59
-                char v = 48 + (((val >> (num_nibbles - 1) * 4)) & 0x0F);
59
+                char v = 48 + (((val >> (num_nybbles - 1) * 4)) & 0x0F);
60 60
                 if(v > 57) v += 7;
61 61
                 USB_HOST_SERIAL.print(v);
62
-        } while(--num_nibbles);
62
+        } while(--num_nybbles);
63 63
 }
64 64
 
65 65
 template <class T>

+ 3
- 3
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h View File

@@ -96,7 +96,7 @@ uint8_t* UHS_NI MAX3421E_HOST::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* dat
96 96
 /* GPIO write                                           */
97 97
 /*GPIO byte is split between 2 registers, so two writes are needed to write one byte */
98 98
 
99
-/* GPOUT bits are in the low nibble. 0-3 in IOPINS1, 4-7 in IOPINS2 */
99
+/* GPOUT bits are in the low nybble. 0-3 in IOPINS1, 4-7 in IOPINS2 */
100 100
 void UHS_NI MAX3421E_HOST::gpioWr(uint8_t data) {
101 101
         regWr(rIOPINS1, data);
102 102
         data >>= 4;
@@ -132,11 +132,11 @@ uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* dat
132 132
 
133 133
 /* GPIO read. See gpioWr for explanation */
134 134
 
135
-/* GPIN pins are in high nibbles of IOPINS1, IOPINS2    */
135
+/* GPIN pins are in high nybbles of IOPINS1, IOPINS2    */
136 136
 uint8_t UHS_NI MAX3421E_HOST::gpioRd() {
137 137
         uint8_t gpin = 0;
138 138
         gpin = regRd(rIOPINS2); //pins 4-7
139
-        gpin &= 0xF0; //clean lower nibble
139
+        gpin &= 0xF0; //clean lower nybble
140 140
         gpin |= (regRd(rIOPINS1) >> 4); //shift low bits and OR with upper from previous operation.
141 141
         return ( gpin);
142 142
 }

Loading…
Cancel
Save