Skip to content

Commit 77e867d

Browse files
committed
created shell script called readreg.sh to read a set register
1 parent c4f02ba commit 77e867d

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#define configUSE_IDLE_HOOK 0
5858
#define configUSE_TICK_HOOK 0
5959
#define configCPU_CLOCK_HZ ( 48000000U )
60-
#define configTICK_RATE_HZ ( ( TickType_t ) 10 )
60+
#define configTICK_RATE_HZ ( ( TickType_t ) 50 )
6161
#define configMAX_PRIORITIES ( 7 )
6262
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 512 )
6363
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40 * 1024 ) )

include/i2c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Date: 12/30/2024
2323
#define I2C2_TXDR (*((volatile uint32_t *) (I2C2 + 0x28)))
2424

2525
#define TSL2591_ADDRESS (0x29U)
26-
#define TSL2591_DATA_REGISTER (0xB4U)
26+
#define TSL2591_DATA_REGISTER (0xB4U)
2727
#define TSL2591_INIT_MESSAGE ((0xA0 << 8)|(0x03))
2828

2929
#define I2C2_NBYTES (4U)

readreg.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This small bash script reads the value of a register on an MCU and prints it to terminal
2+
# note for use: make sure another terminal is open that has already ran the `make load` command
3+
4+
# edit reg to be address of register to be read
5+
reg=0x10000000
6+
7+
# open client, read value of reg, print value out to terminal, then quit
8+
make client 2>&1 <<EOF | grep $reg
9+
start
10+
monitor mdw $reg 1
11+
q
12+
EOF
13+

src/exti.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void exti_disable(void) {
3333
void EXTI15_10_IRQHandler(void) {
3434
BaseType_t xHigherPriorityTaskWoken = pdFALSE; //init a var to hold whether a higher priority task is being blocked by the button binary semaphore
3535
xSemaphoreGiveFromISR(p_button_binary_semaphore, &xHigherPriorityTaskWoken); //give button_binary_semaphore away
36-
36+
3737
EXTI_PR1 |= (1 << 13); //clear pending interrupts on this line
3838

3939
portYIELD_FROM_ISR(xHigherPriorityTaskWoken); //force context switch to higher priority blocked task (if there is one)

src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ int main(void) {
8383
lux_data_queue = xQueueCreate(8, (size_t) 4); //create queue with 8 indeces, with each index having a max size of 4 bytes
8484
configASSERT(lux_data_queue != NULL);
8585

86-
status = xTaskCreate( (TaskFunction_t) task1_handler, "lux_task", STACK_SIZE, NULL, 1, NULL);
86+
status = xTaskCreate( (TaskFunction_t) task1_handler, "lux_task", STACK_SIZE, NULL, 3, NULL);
8787
configASSERT(status == pdPASS);
8888

89-
status = xTaskCreate( (TaskFunction_t) task2_handler, "lcd_task", STACK_SIZE, NULL, 1, NULL);
89+
status = xTaskCreate( (TaskFunction_t) task2_handler, "lcd_task", STACK_SIZE, NULL, 3, NULL);
9090
configASSERT(status == pdPASS);
9191

92-
status = xTaskCreate( (TaskFunction_t) task3_handler, "lcd_task", STACK_SIZE, NULL, 1, NULL);
92+
status = xTaskCreate( (TaskFunction_t) task3_handler, "misc_task", STACK_SIZE, NULL, 3, NULL);
9393
configASSERT(status == pdPASS);
9494

9595
vTaskStartScheduler();

start

Whitespace-only changes.

0 commit comments

Comments
 (0)