Skip to content

Commit

Permalink
Merge pull request s-matyukevich#219 from gpiffault/master
Browse files Browse the repository at this point in the history
Fix typo in lesson01
  • Loading branch information
s-matyukevich authored Jan 12, 2021
2 parents 1d8364b + bdcaa90 commit 83ce425
Show file tree
Hide file tree
Showing 83 changed files with 240 additions and 240 deletions.
2 changes: 1 addition & 1 deletion docs/lesson01/rpi-os.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/H-4ND-H/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
2 changes: 1 addition & 1 deletion exercises/lesson01/1/a-v-v/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void uart_init ( unsigned int baudrate )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
10 changes: 5 additions & 5 deletions exercises/lesson01/1/adkaster/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -16,7 +16,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand All @@ -34,9 +34,9 @@ void uart_init ( miniuart_baud_t baud_rate )
unsigned int selector;

/* Final baudrate = system_clock_freq / (8 * ( baudrate_reg + 1 ))
* From docs, system_clock_freq = 250MHz
* From docs, system_clock_freq = 250MHz
* Solve for baudrate_reg:
* baudrate_reg = (system_clock_freq / (8*baudrate)) - 1
* baudrate_reg = (system_clock_freq / (8*baudrate)) - 1
* baudrate_reg = 31.25MHz/baudrate - 1
* baudrate_reg = 31250000/baudrate -1
* baudrate_reg is a 32 bit register, but per BCM2835-ARM-Peripherals.pdf, only bottom 16 are read
Expand All @@ -57,7 +57,7 @@ void uart_init ( miniuart_baud_t baud_rate )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
8 changes: 4 additions & 4 deletions exercises/lesson01/1/avenito/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand All @@ -30,7 +30,7 @@ void uart_send_string(char* str)
void uart_init ( int baudrate )
{
unsigned int selector;

if(baudrate == 0) baudrate = 270;

selector = get32(GPFSEL1);
Expand All @@ -46,7 +46,7 @@ void uart_init ( int baudrate )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/bl4ckout31/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
2 changes: 1 addition & 1 deletion exercises/lesson01/1/evopen/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void uart_init(void) {
put32(GPPUDCLK0, 0);

put32(AUX_ENABLES,
1); // Enable mini uart (this also enables access to it registers)
1); // Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG, 0); // Disable auto flow control
put32(AUX_MU_IER_REG, 0); // Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG, 3); // Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/gcrisis/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -16,7 +16,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -46,7 +46,7 @@ void uart_init (int baudrate )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
2 changes: 1 addition & 1 deletion exercises/lesson01/1/rs/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void uart_init(void) {
put32(GPPUDCLK0, 0);

put32(AUX_ENABLES, 1); // Enable mini uart
// (this also enables access to it registers)
// (this also enables access to its registers)
put32(AUX_MU_CNTL_REG, 0); // Disable auto flow control and disable receiver
// and transmitter (for now)
put32(AUX_MU_IER_REG, 0); // Disable receive and transmit interrupts
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/stefanji/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init (unsigned int rate)
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/xdfm1/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -49,7 +49,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/1/zjd0112/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -45,7 +45,7 @@ void uart_init ( unsigned int baud_rate )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/2/adkaster/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void mini_uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void mini_uart_send ( char c )
char mini_uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void mini_uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/2/zjd0112/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/3/a-v-v/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
6 changes: 3 additions & 3 deletions exercises/lesson01/3/adkaster/src/mini_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
void uart_send ( char c )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x20)
if(get32(AUX_MU_LSR_REG)&0x20)
break;
}
put32(AUX_MU_IO_REG,c);
Expand All @@ -14,7 +14,7 @@ void uart_send ( char c )
char uart_recv ( void )
{
while(1) {
if(get32(AUX_MU_LSR_REG)&0x01)
if(get32(AUX_MU_LSR_REG)&0x01)
break;
}
return(get32(AUX_MU_IO_REG)&0xFF);
Expand Down Expand Up @@ -44,7 +44,7 @@ void uart_init ( void )
delay(150);
put32(GPPUDCLK0,0);

put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to it registers)
put32(AUX_ENABLES,1); //Enable mini uart (this also enables access to its registers)
put32(AUX_MU_CNTL_REG,0); //Disable auto flow control and disable receiver and transmitter (for now)
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
Expand Down
Loading

0 comments on commit 83ce425

Please sign in to comment.