# IDE Flags (Keeps various IDEs happy)\r
##########################################################################\r
\r
-OPTDEFINES = -D __NEWLIB__ -DR0KET\r
+OPTDEFINES = -D __NEWLIB__ -DHOB_REV2\r
\r
##########################################################################\r
# Project-specific files \r
static void badge_init_backlight(void) {
HOB_SET_PIN_FUNC(HOB_LCD_BACKLIGHT, CLKOUT);
+ // wdtInit(false);
SCB_CLKOUTCLKSEL = SCB_MAINCLKSEL_SOURCE_INTERNALOSC;
SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_DISABLE;
SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_UPDATE;
gpioSetPullup(&HOB_IOCON(spec), (mode)); \
} while(0)
+#ifdef HOB_REV2
+ INPUT_PIN_CONFIG(HOB_BTN_UP , gpioPullupMode_PullUp);
+ INPUT_PIN_CONFIG(HOB_BTN_RIGHT , gpioPullupMode_PullUp);
+ INPUT_PIN_CONFIG(HOB_BTN_DOWN , gpioPullupMode_PullUp);
+ INPUT_PIN_CONFIG(HOB_BTN_LEFT , gpioPullupMode_PullUp);
+ INPUT_PIN_CONFIG(HOB_BTN_A , gpioPullupMode_PullUp);
+ INPUT_PIN_CONFIG(HOB_BTN_B , gpioPullupMode_PullUp);
+#else
INPUT_PIN_CONFIG(HOB_BTN_UP , gpioPullupMode_PullDown);
INPUT_PIN_CONFIG(HOB_BTN_RIGHT , gpioPullupMode_PullDown);
INPUT_PIN_CONFIG(HOB_BTN_DOWN , gpioPullupMode_PullDown);
INPUT_PIN_CONFIG(HOB_BTN_CENTER, gpioPullupMode_PullDown);
INPUT_PIN_CONFIG(HOB_BTN_A , gpioPullupMode_PullDown);
INPUT_PIN_CONFIG(HOB_BTN_B , gpioPullupMode_PullDown);
+#endif
+
#undef INPUT_PIN_CONFIG
#define OUTPUT_PIN_CONFIG(spec, value) do { \
if(rectangle_intersect(&rect_self, &rect_hacker)) {
if(fixed_point_gt(state->inertia.y, FIXED_POINT(0, 0))) {
self->flags &= ~JUMPNRUN_ENEMY_SPAWNED;
- state->inertia_mod.y = FIXED_POINT(0, -167);
+ state->inertia_mod.y = FIXED_POINT(0, -250);
state->jumpable_frames = 12;
} else {
state->status = JUMPNRUN_DEAD;
uint32_t volatile *reg;
gpioPullupMode_t mode;
} const input_pins[] = {
+#ifdef HOB_REV2
+ { RB_BTN0 , &RB_BTN0_IO , gpioPullupMode_PullDown },
+ { RB_BTN1 , &RB_BTN1_IO , gpioPullupMode_PullDown },
+ { RB_BTN2 , &RB_BTN2_IO , gpioPullupMode_PullDown },
+ { RB_BTN3 , &RB_BTN3_IO , gpioPullupMode_PullDown },
+ { RB_BTN4 , &RB_BTN4_IO , gpioPullupMode_PullDown },
+ { RB_HB0 , &RB_HB0_IO , gpioPullupMode_PullDown },
+ { RB_HB1 , &RB_HB1_IO , gpioPullupMode_PullDown },
+ { RB_PWR_CHRG, &RB_PWR_CHRG_IO, gpioPullupMode_PullDown }
+#else
{ RB_BTN0 , &RB_BTN0_IO , gpioPullupMode_PullUp },
{ RB_BTN1 , &RB_BTN1_IO , gpioPullupMode_PullUp },
{ RB_BTN2 , &RB_BTN2_IO , gpioPullupMode_PullUp },
{ RB_HB0 , &RB_HB0_IO , gpioPullupMode_PullUp },
{ RB_HB1 , &RB_HB1_IO , gpioPullupMode_PullUp },
{ RB_PWR_CHRG, &RB_PWR_CHRG_IO, gpioPullupMode_PullUp }
+#endif
};
for(int i = 0; i < ARRAY_SIZE(input_pins); ++i) {
#include <lpc134x.h>
+#ifdef HOB_REV2
+
+#define HOB_BTN_UP (1, 11)
+#define HOB_BTN_RIGHT (1, 7)
+#define HOB_BTN_DOWN (1, 6)
+#define HOB_BTN_LEFT (1, 5)
+#define HOB_BTN_A (1, 9)
+#define HOB_BTN_B (1, 8)
+
+#define HOB_LCD_CS (3, 0)
+#define HOB_LCD_RST (3, 1)
+#define HOB_LCD_BACKLIGHT (0, 1)
+
+#define HOB_DATAFLASH_CS (0, 7)
+
+#define HOB_RADIO_CE (2, 2)
+#define HOB_RADIO_CS (2, 10)
+#define HOB_RADIO_IRQ (2, 9)
+
+#define HOB_USB_CONNECT (0, 6)
+
+
+#else
+
#define HOB_BTN_UP (3, 2)
#define HOB_BTN_RIGHT (1, 5)
#define HOB_BTN_DOWN (1, 6)
#define HOB_USB_CONNECT (0, 6)
+#endif
+
#define HOB_PIO0_0 nRESET_PIO0_0
#define HOB_PIO0_1 PIO0_1
#define HOB_PIO0_2 PIO0_2
if (gpioGetValue(RB_BTN1) == 0) { result |= BADGE_EVENT_KEY_LEFT ; }
if (gpioGetValue(RB_HB0 ) == 0) { result |= BADGE_EVENT_KEY_BTN_A ; }
if (gpioGetValue(RB_HB1 ) == 0) { result |= BADGE_EVENT_KEY_BTN_B ; }
+#elif defined(HOB_REV2)
+ if (gpioGetValue(HOB_PORT(HOB_BTN_UP ), HOB_PIN(HOB_BTN_UP )) == 0) { result |= BADGE_EVENT_KEY_UP ; }
+ if (gpioGetValue(HOB_PORT(HOB_BTN_DOWN ), HOB_PIN(HOB_BTN_DOWN )) == 0) { result |= BADGE_EVENT_KEY_DOWN ; }
+ if (gpioGetValue(HOB_PORT(HOB_BTN_LEFT ), HOB_PIN(HOB_BTN_LEFT )) == 0) { result |= BADGE_EVENT_KEY_LEFT ; }
+ if (gpioGetValue(HOB_PORT(HOB_BTN_RIGHT ), HOB_PIN(HOB_BTN_RIGHT )) == 0) { result |= BADGE_EVENT_KEY_RIGHT ; }
+ if (gpioGetValue(HOB_PORT(HOB_BTN_A ), HOB_PIN(HOB_BTN_A )) == 0) { result |= BADGE_EVENT_KEY_BTN_A ; }
+ if (gpioGetValue(HOB_PORT(HOB_BTN_B ), HOB_PIN(HOB_BTN_B )) == 0) { result |= BADGE_EVENT_KEY_BTN_B ; }
#else
if (gpioGetValue(HOB_PORT(HOB_BTN_UP ), HOB_PIN(HOB_BTN_UP )) == 1) { result |= BADGE_EVENT_KEY_UP ; }
if (gpioGetValue(HOB_PORT(HOB_BTN_DOWN ), HOB_PIN(HOB_BTN_DOWN )) == 1) { result |= BADGE_EVENT_KEY_DOWN ; }