+++ /dev/null
-#!/bin/sh
-openocd \
- -f interface/stlink-v2-1.cfg\
- -c "transport select hla_swd"\
- -f target/stm32f7x.cfg \
- -c init\
- -c "reset halt"\
- -c "flash write_image erase "build/mTask.bin" 0x08000000"\
- -c "reset run"\
- -c shutdown
sdPut(&SD3, b);
}
+uint64_t dpins[] = {LINE_ARD_D0, LINE_ARD_D1, LINE_ARD_D2, LINE_ARD_D3,
+ LINE_ARD_D4, LINE_ARD_D5, LINE_ARD_D6, LINE_ARD_D7, LINE_ARD_D8,
+ LINE_ARD_D9, LINE_ARD_D10, LINE_ARD_D11, LINE_ARD_D12, LINE_ARD_D13,
+ LINE_ARD_D14, LINE_ARD_D15};
void write_dpin(uint8_t i, bool b)
{
- (void) i;
- (void) b;
+ if(i == 0){ palWriteLine(LINE_LED1, b ? PAL_HIGH : PAL_LOW);
+ } else if(i == 1){ palWriteLine(LINE_LED2, b ? PAL_HIGH : PAL_LOW);
+ } else if(i == 2){ palWriteLine(LINE_LED3, b ? PAL_HIGH : PAL_LOW);
+ }
+ palWriteLine(dpins[i], b ? PAL_HIGH : PAL_LOW);
}
bool read_dpin(uint8_t i)
{
- return 0;
- (void) i;
+ return palReadLine(dpins[i]) == PAL_HIGH;
}
void write_apin(uint8_t i, uint8_t a)
{
- if(a){
- if(i == 0){
- palSetLine(LINE_LED1);
- } else if(i == 1){
- palSetLine(LINE_LED2);
- } else if(i == 2){
- palSetLine(LINE_LED3);
- }
- } else {
- if(i == 0){
- palClearLine(LINE_LED1);
- } else if(i == 1){
- palClearLine(LINE_LED2);
- } else if(i == 2){
- palClearLine(LINE_LED3);
- }
- }
+ (void) i;
+ (void) a;
}
uint8_t read_apin(uint8_t i)
gargv = argv;
#endif
- read_byte();
//Initialize systems
setup();
sds_init();
processSDSs s y [x:xs] = updateSDSs s y x >>= \_->processSDSs s y xs
updateSDSs :: [(Int, Shared Int)] (Shared [String]) MTaskMSGRecv -> Task ()
- updateSDSs _ m (MTMessage s) = upd (\l->[s:l]) m @! ()
+ updateSDSs _ m (MTMessage s) = upd (\l->take 20 [s:l]) m @! ()
updateSDSs _ _ MTEmpty = return ()
updateSDSs [(id, sh):xs] m n=:(MTPub i d)
| id == i = set ((toInt d.[0])*265 + toInt d.[1]) sh @! ()
bc = sds \x=1 In sds \pinnetje=1 In {main =
x =. x +. pinnetje :.
pub x :.
+ digitalWrite D0 (lit False) :.
+ digitalWrite D1 (lit False) :.
+ digitalWrite D2 (lit False) :.
IF (pinnetje ==. lit 1) (
- analogWrite A0 (lit 1) :.
- analogWrite A1 (lit 0) :.
- analogWrite A2 (lit 0)
+ digitalWrite D0 (lit True)
) (
IF (pinnetje ==. lit 2) (
- analogWrite A0 (lit 0) :.
- analogWrite A1 (lit 1) :.
- analogWrite A2 (lit 0)
+ digitalWrite D1 (lit True)
) (
- analogWrite A0 (lit 0):.
- analogWrite A1 (lit 0):.
- analogWrite A2 (lit 1)
+ digitalWrite D2 (lit True)
)
)}
// bc :: Main (ByteCode Int Stmt)