Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Wallaby2 #22

Open
wants to merge 1 commit into
base: wallaby-v8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main()
//readAccel();
//readMag();
//readGyro();
readIMU();
if(count%1000==0)readIMU();
Copy link
Author

Choose a reason for hiding this comment

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

TODO: better update frequency control


if (batt < 636) // about 5.75 volts
{
Expand Down
5 changes: 5 additions & 0 deletions wallaby.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include "wallaby_uart.h"


// Wallaby2
#ifndef WALLABY2
#define WALLABY2
Copy link
Author

Choose a reason for hiding this comment

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

Don't default to WALLABY2 in this way if it is missing... what if we were a WALLABY

#endif


#ifdef USE_CROSS_STUDIO_DEBUG
#include <__cross_studio_io.h>
Expand Down
16 changes: 16 additions & 0 deletions wallaby_dig.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ void update_dig_pin_from_reg(uint32_t pin, GPIO_TypeDef* port, uint8_t output_en
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
}

#ifdef WALLABY2

// Wallaby22
if (pullup_enable)
{
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
}
else
{
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
}
#else

// Wallaby1
if (pullup_enable)
{
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
Expand All @@ -49,6 +63,8 @@ void update_dig_pin_from_reg(uint32_t pin, GPIO_TypeDef* port, uint8_t output_en
{
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
}
#endif


GPIO_Init(port, &GPIO_InitStructure);
}
Expand Down
4 changes: 2 additions & 2 deletions wallaby_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ void handle_dma()
}
else
{
//debug_printf("got bad spi packet with start %d version %d tot %d\n", aRxBuffer[0], aRxBuffer[1], aRxBuffer[REG_READABLE_COUNT-1]);
debug_printf("got bad spi packet with start %d version %d tot %d\n", aRxBuffer[0], aRxBuffer[1], aRxBuffer[REG_READABLE_COUNT-1]);
if (aRxBuffer[1] == WALLABY_SPI_VERSION)
{
//debug_printf("SPI protocol version mismatch\n");
debug_printf("SPI protocol version mismatch\n");
}
}
// Clear DMA Transfer Complete Flags so we can notice when a transfer happens again
Expand Down
Loading