Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

[SOFT 999] FW 103 HW - #504

Open
m6keller wants to merge 7 commits into
masterfrom
soft_999_fw_103_hw
Open

[SOFT 999] FW 103 HW#504
m6keller wants to merge 7 commits into
masterfrom
soft_999_fw_103_hw

Conversation

@m6keller

@m6keller m6keller commented Mar 2, 2022

Copy link
Copy Markdown

FW 103 HW

@m6keller m6keller changed the title Soft 999 fw 103 hw [SOFT 999] FW 103 HW Mar 2, 2022

@mitchellostler mitchellostler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but there are a few issues that will prevent the program from compiling. You should run make run PROJECT=fw_103_hw PLATFORM=x86

Comment thread projects/fw_103_hw/src/main.c Outdated
Comment thread projects/fw_103_hw/src/main.c Outdated
Comment thread projects/fw_103_hw/src/main.c Outdated
.priority = INTERRUPT_PRIORITY_HIGH,
};

adc_set_channel_pin(button_addr, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The adc should be set for the potentiometer pin, instead of the button

Comment thread projects/fw_103_hw/src/main.c Outdated
Comment thread projects/fw102_example/src/main.c

@mitchellostler mitchellostler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FW 103 looks good, just a couple of fixes and you should be good to go. Were you able to get it to run?

Also a note: You should really put your name in your branch name, since there are other people using the same ticket number for homework



// GPIO address that we will allow us to read button data
const GpioAddress potentiometer_addr_A6 = { // could be passed as context

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good programming practice is to not to use global variables (ie any variable that is non-static declared outside a function). The const is good since they won't be changed, but declare them static as well const static

adc_init(ADC_MODE_SINGLE);

// GPIO Address where button is pressed
GpioAddress potentiometer_addr_B2 = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't be a potentiometer address, this would be a button address, so it would be good to label it as such

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants