diff --git a/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Builder.launch b/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Builder.launch deleted file mode 100644 index c34dfd5..0000000 --- a/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Builder.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Cleaner.launch b/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Cleaner.launch deleted file mode 100644 index 616ed7c..0000000 --- a/BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Cleaner.launch +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/BlinkerLaunchPad/.project b/BlinkerLaunchPad/.project deleted file mode 100644 index 99aa023..0000000 --- a/BlinkerLaunchPad/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - BlinkerLaunchPad - - - BlinkerSchema - - - - org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, - - - LaunchConfigHandle - <project>/.externalToolBuilders/Blinker LaunchPad Builder.launch - - - - - org.eclipse.ui.externaltools.ExternalToolBuilder - clean, - - - LaunchConfigHandle - <project>/.externalToolBuilders/Blinker LaunchPad Cleaner.launch - - - - - - com.emmoco.mcmtooling.example.mcmToolingExampleNature - - diff --git a/BlinkerLaunchPad/Blinker.obj b/BlinkerLaunchPad/Blinker.obj deleted file mode 100644 index a7bde40..0000000 --- a/BlinkerLaunchPad/Blinker.obj +++ /dev/null diff --git a/BlinkerLaunchPad/Log/log.txt b/BlinkerLaunchPad/Log/log.txt deleted file mode 100644 index e69de29..0000000 --- a/BlinkerLaunchPad/Log/log.txt +++ /dev/null diff --git a/BlinkerLaunchPad/main.c b/BlinkerLaunchPad/main.c deleted file mode 100644 index 8479ccd..0000000 --- a/BlinkerLaunchPad/main.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * ============ Platform Configuration ============ - */ - -#include - -#define LED_ON() (P1OUT |= BIT6) -#define LED_OFF() (P1OUT &= ~BIT6) -#define LED_READ() (P1OUT & BIT6) -#define LED_TOGGLE() (P1OUT ^= BIT6) - -#define CONNECTED_LED_ON() (P1OUT |= BIT0) -#define CONNECTED_LED_OFF() (P1OUT &= ~BIT0) - -#define EAP_RX_BUF UCA0RXBUF -#define EAP_TX_BUF UCA0TXBUF - -#define EAP_RX_VECTOR USCIAB0RX_VECTOR -#define EAP_TX_VECTOR PORT2_VECTOR - -#define EAP_RX_ACK_CONFIG() (P2DIR |= BIT0) -#define EAP_RX_ACK_SET() (P2OUT |= BIT0) -#define EAP_RX_ACK_CLR() (P2OUT &= ~BIT0) - -#define EAP_TX_INT_CONFIG() (P2DIR &= ~BIT1, P2IES |= BIT1, P2IFG &= BIT1, P2IE |= BIT1) -#define EAP_TX_INT_TST() (P2IFG & BIT1) -#define EAP_TX_INT_CLR() (P2IFG &= ~BIT1) - -void init(void) { - - WDTCTL = WDTPW + WDTHOLD; - BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0; - if (CALBC1_1MHZ != 0xFF) { - DCOCTL = 0x00; - BCSCTL1 = CALBC1_1MHZ; /* Set DCO to 1MHz */ - DCOCTL = CALDCO_1MHZ; - } - BCSCTL1 |= XT2OFF + DIVA_0; - BCSCTL3 = XT2S_0 + LFXT1S_2 + XCAP_1; - - P1DIR |= BIT0; /* LED */ - LED_OFF(); - P1DIR |= BIT6; /* CONNECTED_LED */ - CONNECTED_LED_OFF(); - - UCA0CTL1 |= UCSWRST; - - P1SEL |= BIT1 + BIT2; - P1SEL2 |= BIT1 + BIT2; - - EAP_RX_ACK_CONFIG(); - EAP_RX_ACK_SET(); - - EAP_TX_INT_CONFIG(); - - UCA0CTL1 = UCSSEL_2 + UCSWRST; - UCA0MCTL = UCBRF_0 + UCBRS_6; - UCA0BR0 = 8; - UCA0CTL1 &= ~UCSWRST; - - IFG2 &= ~(UCA0RXIFG); - IE2 |= UCA0RXIE; - - TA1CCTL0 = CM_0 + CCIS_0 + OUTMOD_0 + CCIE; - TA1CCR0 = 1200; - TA1CTL = TASSEL_1 + ID_0 + MC_1; - - __enable_interrupt(); -} - -/* - * ============ Serial Driver ============ - */ - -#include - -__attribute__((interrupt(EAP_RX_VECTOR))) -static void rxHandler(void) { - uint8_t b = EAP_RX_BUF; - if (Em_Message_addByte(b)) { - Em_Message_dispatch(); - } - EAP_RX_ACK_CLR(); - EAP_RX_ACK_SET(); -} - -__attribute__((interrupt(EAP_TX_VECTOR))) -static void txHandler(void) { - if (EAP_TX_INT_TST()) { - uint8_t b; - if (Em_Message_getByte(&b)) { - EAP_TX_BUF = b; - } - EAP_TX_INT_CLR(); - } -} - -void Em_Message_startSend() { - uint8_t b; - if (Em_Message_getByte(&b)) { - UCA0TXBUF = b; - } -} - -uint8_t Em_Message_lock() { - uint8_t key; - asm ("MOV r2, %0": "=r" (key)); - key &= 0x8; - asm ("DINT"); - return key; -} - -void Em_Message_unlock(uint8_t key) { - if (key) { - asm ("EINT"); - } - else { - asm ("DINT"); - } -} - -/* - * ============ Application Program ============ - */ - -#include - -#define COUNT_DEFAULT 5 - -volatile Blinker_cmd_t cmdRes = Blinker_STOP_CMD; -volatile Blinker_count_t countRes = COUNT_DEFAULT; -volatile Blinker_delay_t delayRes = Blinker_delay_min; - -volatile Blinker_count_t curCount; -volatile Blinker_delay_t curTime; - -__attribute__((interrupt(TIMER1_A0_VECTOR))) -void tickHandler(void) { - if (cmdRes == Blinker_STOP_CMD) { - return; - } - if (curTime < delayRes) { - curTime += Blinker_delay_step; - return; - } - else { - curTime = 0; - } - if (curCount-- > 0) { - LED_TOGGLE(); - } - else { - cmdRes = Blinker_STOP_CMD; - LED_OFF(); - } - Blinker_ledState_indicate(); -} - -int main(int argc, char *argv[]) { - volatile int dummy = 0; - init(); - Blinker_run(); - while (dummy == 0) { - /* idle */ - } - return 0; -} - -void Blinker_connectHandler(void) { - CONNECTED_LED_ON(); -} - -void Blinker_disconnectHandler(void) { - CONNECTED_LED_OFF(); -} - -void Blinker_cmd_store(Blinker_cmd_t* input) { - cmdRes = *input; - switch (cmdRes) { - case Blinker_START_CMD: - curCount = countRes * 2; - curTime = 0; - break; - case Blinker_STOP_CMD: - LED_OFF(); - break; - } -} - -void Blinker_count_fetch(Blinker_count_t* output) { - *output = countRes; -} - -void Blinker_count_store(Blinker_count_t* input) { - countRes = *input; -} - -void Blinker_delay_fetch(Blinker_delay_t* output) { - *output = delayRes; -} - -void Blinker_delay_store(Blinker_delay_t* input) { - delayRes = *input; -} - -void Blinker_ledState_fetch(Blinker_ledState_t* output) { - *output = LED_READ() ? Blinker_LED_ON : Blinker_LED_OFF; -} diff --git a/BlinkerLaunchPad/main.map b/BlinkerLaunchPad/main.map deleted file mode 100644 index 88ac95a..0000000 --- a/BlinkerLaunchPad/main.map +++ /dev/null @@ -1,597 +0,0 @@ -Archive member included because of file (symbol) - -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_reset_vector__) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__watchdog_support) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__init_stack) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__low_level_init) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_copy_data) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_clear_bss) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__stop_progExec__) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (_endless_loop__) -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_unexpected_) - -Allocating common symbols -Common symbol size file - -Em_App_recvIdx 0x1 Blinker.obj -Em_App_xmitSize 0x1 Blinker.obj -Em_App_outBuf 0x2 Blinker.obj -curTime 0x2 main.obj -Em_App_ind 0xa Blinker.obj -Em_App_xmitMask 0x4 Blinker.obj -Em_App_msg 0x1a Blinker.obj -Em_App_recvSize 0x1 Blinker.obj -Em_App_fileIndex 0x4 Blinker.obj -Em_App_pdHdlr 0x2 Blinker.obj -Em_App_xmitIdx 0x1 Blinker.obj -curCount 0x2 main.obj - -Memory Configuration - -Name Origin Length Attributes -sfr 0x0000000000000000 0x0000000000000010 -peripheral_8bit 0x0000000000000010 0x00000000000000f0 -peripheral_16bit 0x0000000000000100 0x0000000000000100 -ram 0x0000000000000200 0x0000000000000200 xw -infomem 0x0000000000001000 0x0000000000000100 -infod 0x0000000000001000 0x0000000000000040 -infoc 0x0000000000001040 0x0000000000000040 -infob 0x0000000000001080 0x0000000000000040 -infoa 0x00000000000010c0 0x0000000000000040 -rom 0x000000000000c000 0x0000000000003fe0 xr -vectors 0x000000000000ffe0 0x0000000000000020 -bsl 0x0000000000000000 0x0000000000000000 -far_rom 0x0000000000000000 0x0000000000000000 -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o -LOAD main.obj -LOAD Blinker.obj -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a - 0x0000000000000040 PROVIDE (__info_segment_size, 0x40) - 0x0000000000001000 PROVIDE (__infod, 0x1000) - 0x0000000000001040 PROVIDE (__infoc, 0x1040) - 0x0000000000001080 PROVIDE (__infob, 0x1080) - 0x00000000000010c0 PROVIDE (__infoa, 0x10c0) - 0x0000000000000000 __IE1 = 0x0 - 0x0000000000000002 __IFG1 = 0x2 - 0x0000000000000001 __IE2 = 0x1 - 0x0000000000000003 __IFG2 = 0x3 - 0x0000000000000048 __ADC10DTC0 = 0x48 - 0x0000000000000049 __ADC10DTC1 = 0x49 - 0x000000000000004a __ADC10AE0 = 0x4a - 0x00000000000001b0 __ADC10CTL0 = 0x1b0 - 0x00000000000001b2 __ADC10CTL1 = 0x1b2 - 0x00000000000001b4 __ADC10MEM = 0x1b4 - 0x00000000000001bc __ADC10SA = 0x1bc - 0x0000000000000056 __DCOCTL = 0x56 - 0x0000000000000057 __BCSCTL1 = 0x57 - 0x0000000000000058 __BCSCTL2 = 0x58 - 0x0000000000000053 __BCSCTL3 = 0x53 - 0x0000000000000059 __CACTL1 = 0x59 - 0x000000000000005a __CACTL2 = 0x5a - 0x000000000000005b __CAPD = 0x5b - 0x0000000000000128 __FCTL1 = 0x128 - 0x000000000000012a __FCTL2 = 0x12a - 0x000000000000012c __FCTL3 = 0x12c - 0x0000000000000020 __P1IN = 0x20 - 0x0000000000000021 __P1OUT = 0x21 - 0x0000000000000022 __P1DIR = 0x22 - 0x0000000000000023 __P1IFG = 0x23 - 0x0000000000000024 __P1IES = 0x24 - 0x0000000000000025 __P1IE = 0x25 - 0x0000000000000026 __P1SEL = 0x26 - 0x0000000000000041 __P1SEL2 = 0x41 - 0x0000000000000027 __P1REN = 0x27 - 0x0000000000000028 __P2IN = 0x28 - 0x0000000000000029 __P2OUT = 0x29 - 0x000000000000002a __P2DIR = 0x2a - 0x000000000000002b __P2IFG = 0x2b - 0x000000000000002c __P2IES = 0x2c - 0x000000000000002d __P2IE = 0x2d - 0x000000000000002e __P2SEL = 0x2e - 0x0000000000000042 __P2SEL2 = 0x42 - 0x000000000000002f __P2REN = 0x2f - 0x0000000000000018 __P3IN = 0x18 - 0x0000000000000019 __P3OUT = 0x19 - 0x000000000000001a __P3DIR = 0x1a - 0x000000000000001b __P3SEL = 0x1b - 0x0000000000000043 __P3SEL2 = 0x43 - 0x0000000000000010 __P3REN = 0x10 - 0x000000000000012e __TA0IV = 0x12e - 0x0000000000000160 __TA0CTL = 0x160 - 0x0000000000000162 __TA0CCTL0 = 0x162 - 0x0000000000000164 __TA0CCTL1 = 0x164 - 0x0000000000000166 __TA0CCTL2 = 0x166 - 0x0000000000000170 __TA0R = 0x170 - 0x0000000000000172 __TA0CCR0 = 0x172 - 0x0000000000000174 __TA0CCR1 = 0x174 - 0x0000000000000176 __TA0CCR2 = 0x176 - 0x000000000000011e __TA1IV = 0x11e - 0x0000000000000180 __TA1CTL = 0x180 - 0x0000000000000182 __TA1CCTL0 = 0x182 - 0x0000000000000184 __TA1CCTL1 = 0x184 - 0x0000000000000186 __TA1CCTL2 = 0x186 - 0x0000000000000190 __TA1R = 0x190 - 0x0000000000000192 __TA1CCR0 = 0x192 - 0x0000000000000194 __TA1CCR1 = 0x194 - 0x0000000000000196 __TA1CCR2 = 0x196 - 0x0000000000000060 __UCA0CTL0 = 0x60 - 0x0000000000000061 __UCA0CTL1 = 0x61 - 0x0000000000000062 __UCA0BR0 = 0x62 - 0x0000000000000063 __UCA0BR1 = 0x63 - 0x0000000000000064 __UCA0MCTL = 0x64 - 0x0000000000000065 __UCA0STAT = 0x65 - 0x0000000000000066 __UCA0RXBUF = 0x66 - 0x0000000000000067 __UCA0TXBUF = 0x67 - 0x000000000000005d __UCA0ABCTL = 0x5d - 0x000000000000005e __UCA0IRTCTL = 0x5e - 0x000000000000005f __UCA0IRRCTL = 0x5f - 0x0000000000000068 __UCB0CTL0 = 0x68 - 0x0000000000000069 __UCB0CTL1 = 0x69 - 0x000000000000006a __UCB0BR0 = 0x6a - 0x000000000000006b __UCB0BR1 = 0x6b - 0x000000000000006c __UCB0I2CIE = 0x6c - 0x000000000000006d __UCB0STAT = 0x6d - 0x000000000000006e __UCB0RXBUF = 0x6e - 0x000000000000006f __UCB0TXBUF = 0x6f - 0x0000000000000118 __UCB0I2COA = 0x118 - 0x000000000000011a __UCB0I2CSA = 0x11a - 0x0000000000000120 __WDTCTL = 0x120 - 0x00000000000010f8 __CALDCO_16MHZ = 0x10f8 - 0x00000000000010f9 __CALBC1_16MHZ = 0x10f9 - 0x00000000000010fa __CALDCO_12MHZ = 0x10fa - 0x00000000000010fb __CALBC1_12MHZ = 0x10fb - 0x00000000000010fc __CALDCO_8MHZ = 0x10fc - 0x00000000000010fd __CALBC1_8MHZ = 0x10fd - 0x00000000000010fe __CALDCO_1MHZ = 0x10fe - 0x00000000000010ff __CALBC1_1MHZ = 0x10ff - -.hash - *(.hash) - -.dynsym - *(.dynsym) - -.dynstr - *(.dynstr) - -.gnu.version - *(.gnu.version) - -.gnu.version_d - *(.gnu.version_d) - -.gnu.version_r - *(.gnu.version_r) - -.rel.init - *(.rel.init) - -.rela.init - *(.rela.init) - -.rel.fini - *(.rel.fini) - -.rela.fini - *(.rela.fini) - -.rel.text - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - -.rela.text - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - -.rel.rodata - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - -.rela.rodata - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - -.rel.data - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - -.rela.data - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - -.rel.bss - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - -.rela.bss - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - -.rel.ctors - *(.rel.ctors) - -.rela.ctors - *(.rela.ctors) - -.rel.dtors - *(.rel.dtors) - -.rela.dtors - *(.rela.dtors) - -.rel.got - *(.rel.got) - -.rela.got - *(.rela.got) - -.rel.plt - *(.rel.plt) - -.rela.plt - *(.rela.plt) - -.text 0x000000000000c000 0x656 - 0x000000000000c000 . = ALIGN (0x2) - *(.init .init.*) - *(.init0) - .init0 0x000000000000c000 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - 0x000000000000c000 _reset_vector__ - *(.init1) - .init1 0x000000000000c000 0xc /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - 0x000000000000c000 __watchdog_support - *(.init2) - .init2 0x000000000000c00c 0x4 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - 0x000000000000c00c __init_stack - *(.init3) - .init3 0x000000000000c010 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - 0x000000000000c010 __low_level_init - *(.init4) - .init4 0x000000000000c010 0x18 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - 0x000000000000c010 __do_copy_data - .init4 0x000000000000c028 0x16 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - 0x000000000000c028 __do_clear_bss - *(.init5) - *(.init6) - *(.init7) - *(.init8) - *(.init9) - .init9 0x000000000000c03e 0x18 main.obj - 0x000000000000c03e main - *(.fini9) - .fini9 0x000000000000c056 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - 0x000000000000c056 __stop_progExec__ - *(.fini8) - *(.fini7) - *(.fini6) - *(.fini5) - *(.fini4) - *(.fini3) - *(.fini2) - *(.fini1) - *(.fini0) - .fini0 0x000000000000c056 0x6 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - 0x000000000000c056 _endless_loop__ - *(.fini .fini.*) - 0x000000000000c05c . = ALIGN (0x2) - 0x000000000000c05c __ctors_start = . - *(.ctors) - 0x000000000000c05c __ctors_end = . - 0x000000000000c05c __dtors_start = . - *(.dtors) - 0x000000000000c05c __dtors_end = . - 0x000000000000c05c . = ALIGN (0x2) - *(.text .text.* .gnu.linkonce.t.*) - .text 0x000000000000c05c 0x4 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - 0x000000000000c05c __isr_1 - 0x000000000000c05c __isr_4 - 0x000000000000c05c __isr_11 - 0x000000000000c05c __isr_5 - 0x000000000000c05c __isr_2 - 0x000000000000c05c __isr_10 - 0x000000000000c05c __isr_0 - 0x000000000000c05c __isr_8 - 0x000000000000c05c __isr_12 - 0x000000000000c05c __isr_9 - 0x000000000000c05c __isr_6 - 0x000000000000c05c __isr_14 - .text.crt0 0x000000000000c060 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .text 0x000000000000c060 0x1f4 main.obj - 0x000000000000c060 init - 0x000000000000c104 __isr_7 - 0x000000000000c130 __isr_3 - 0x000000000000c162 Em_Message_startSend - 0x000000000000c176 Em_Message_lock - 0x000000000000c17e Em_Message_unlock - 0x000000000000c18a tickHandler - 0x000000000000c18a __isr_13 - 0x000000000000c1ea Blinker_connectHandler - 0x000000000000c1f0 Blinker_disconnectHandler - 0x000000000000c1f8 Blinker_cmd_store - 0x000000000000c222 Blinker_count_fetch - 0x000000000000c22a Blinker_count_store - 0x000000000000c230 Blinker_delay_fetch - 0x000000000000c238 Blinker_delay_store - 0x000000000000c23e Blinker_ledState_fetch - .text 0x000000000000c254 0x400 Blinker.obj - 0x000000000000c254 Em_Message_addByte - 0x000000000000c29c Blinker_reset - 0x000000000000c2ca Blinker_run - 0x000000000000c2d0 Em_App_startIndSend - 0x000000000000c2ea Blinker_pairingOn - 0x000000000000c30c Blinker_pairingOff - 0x000000000000c316 Blinker_disconnect - 0x000000000000c338 Blinker_accept - 0x000000000000c356 Em_App_startResSend - 0x000000000000c370 Em_App_xmitReady - 0x000000000000c3c4 Em_App_sendResponse - 0x000000000000c3e8 Em_App_sysStoreDispatch - 0x000000000000c402 Em_App_sysFetchDispatch - 0x000000000000c482 Em_App_fetchDispatch - 0x000000000000c4c0 Em_App_storeDispatch - 0x000000000000c4f8 Em_Message_dispatch - 0x000000000000c556 Em_App_sendIndicator - 0x000000000000c586 Em_Message_getByte - 0x000000000000c63c Blinker_ledState_indicate - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - .text.crt0 0x000000000000c654 0x2 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - 0x000000000000c654 _unexpected_ - 0x000000000000c656 . = ALIGN (0x2) - -.rodata 0x000000000000c656 0x32 - 0x000000000000c656 . = ALIGN (0x2) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata 0x000000000000c656 0x32 Blinker.obj - 0x000000000000c66a Em_App_endian - 0x000000000000c66c Em_App_build - 0x000000000000c674 Em_App_hash - 0x000000000000c688 . = ALIGN (0x2) - 0x000000000000c688 _etext = . - -.data 0x0000000000000200 0xa load address 0x000000000000c688 - 0x0000000000000200 . = ALIGN (0x2) - 0x0000000000000200 PROVIDE (__data_start, .) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000000000000200 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .data 0x0000000000000200 0x6 main.obj - 0x0000000000000200 delayRes - 0x0000000000000202 countRes - 0x0000000000000204 cmdRes - .data 0x0000000000000206 0x4 Blinker.obj - 0x0000000000000206 Em_App_inBuf - 0x0000000000000208 Em_App_readIdle - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - 0x000000000000020a . = ALIGN (0x2) - 0x000000000000020a _edata = . - 0x000000000000c688 PROVIDE (__data_load_start, LOADADDR (.data)) - 0x000000000000000a PROVIDE (__data_size, SIZEOF (.data)) - -.bss 0x000000000000020a 0x3e load address 0x000000000000c692 - 0x000000000000020a PROVIDE (__bss_start, .) - *(.bss .bss.*) - .bss 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .bss 0x000000000000020a 0x0 main.obj - .bss 0x000000000000020a 0x4 Blinker.obj - 0x000000000000020a Em_App_moreData - 0x000000000000020c Em_App_state - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - *(COMMON) - COMMON 0x000000000000020e 0x4 main.obj - 0x000000000000020e curTime - 0x0000000000000210 curCount - COMMON 0x0000000000000212 0x35 Blinker.obj - 0x0000000000000212 Em_App_recvIdx - 0x0000000000000213 Em_App_xmitSize - 0x0000000000000214 Em_App_outBuf - 0x0000000000000216 Em_App_ind - 0x0000000000000220 Em_App_xmitMask - 0x0000000000000224 Em_App_msg - 0x000000000000023e Em_App_recvSize - 0x0000000000000240 Em_App_fileIndex - 0x0000000000000244 Em_App_pdHdlr - 0x0000000000000246 Em_App_xmitIdx - 0x0000000000000248 . = ALIGN (0x2) - *fill* 0x0000000000000247 0x1 00 - 0x0000000000000248 PROVIDE (__bss_end, .) - 0x000000000000003e PROVIDE (__bss_size, SIZEOF (.bss)) - -.noinit 0x0000000000000248 0x2 load address 0x000000000000c692 - 0x0000000000000248 PROVIDE (__noinit_start, .) - *(.noinit .noinit.*) - .noinit.crt0 0x0000000000000248 0x2 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - 0x0000000000000248 __wdt_clear_value - 0x000000000000024a . = ALIGN (0x2) - 0x000000000000024a PROVIDE (__noinit_end, .) - 0x000000000000024a . = ALIGN (0x2) - 0x000000000000024a _end = . - -.infomem 0x0000000000001000 0x0 - *(.infomem) - 0x0000000000001000 . = ALIGN (0x2) - *(.infomem.*) - -.infomemnobits 0x0000000000001000 0x0 - *(.infomemnobits) - 0x0000000000001000 . = ALIGN (0x2) - *(.infomemnobits.*) - -.infoa - *(.infoa .infoa.*) - -.infob - *(.infob .infob.*) - -.infoc - *(.infoc .infoc.*) - -.infod - *(.infod .infod.*) - -.vectors 0x000000000000ffe0 0x20 - 0x000000000000ffe0 PROVIDE (__vectors_start, .) - *(.vectors*) - .vectors 0x000000000000ffe0 0x20 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - 0x000000000000ffe0 __ivtbl_16 - 0x0000000000010000 _vectors_end = . - -.fartext 0x0000000000000000 0x0 - 0x0000000000000000 . = ALIGN (0x2) - *(.fartext) - 0x0000000000000000 . = ALIGN (0x2) - *(.fartext.*) - 0x0000000000000000 _efartext = . - -.profiler - *(.profiler) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment - *(.comment) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x0000000000000000 0xa4 - *(.debug_aranges) - .debug_aranges - 0x0000000000000000 0x18 main.obj - .debug_aranges - 0x0000000000000018 0x14 Blinker.obj - .debug_aranges - 0x000000000000002c 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_aranges - 0x0000000000000040 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_aranges - 0x0000000000000054 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_aranges - 0x0000000000000068 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_aranges - 0x000000000000007c 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_aranges - 0x0000000000000090 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_pubnames - *(.debug_pubnames) - -.debug_info 0x0000000000000000 0x11f6 - *(.debug_info) - .debug_info 0x0000000000000000 0x74e main.obj - .debug_info 0x000000000000074e 0x74e Blinker.obj - .debug_info 0x0000000000000e9c 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_info 0x0000000000000f2b 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_info 0x0000000000000fba 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_info 0x0000000000001049 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_info 0x00000000000010d8 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_info 0x0000000000001167 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - *(.gnu.linkonce.wi.*) - -.debug_abbrev 0x0000000000000000 0x456 - *(.debug_abbrev) - .debug_abbrev 0x0000000000000000 0x1b0 main.obj - .debug_abbrev 0x00000000000001b0 0x22e Blinker.obj - .debug_abbrev 0x00000000000003de 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_abbrev 0x00000000000003f2 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_abbrev 0x0000000000000406 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_abbrev 0x000000000000041a 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_abbrev 0x000000000000042e 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_abbrev 0x0000000000000442 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_line 0x0000000000000000 0x61e - *(.debug_line) - .debug_line 0x0000000000000000 0x16a main.obj - .debug_line 0x000000000000016a 0x205 Blinker.obj - .debug_line 0x000000000000036f 0x72 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_line 0x00000000000003e1 0x70 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_line 0x0000000000000451 0x76 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_line 0x00000000000004c7 0x76 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_line 0x000000000000053d 0x71 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_line 0x00000000000005ae 0x70 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_frame 0x0000000000000000 0x22e - *(.debug_frame) - .debug_frame 0x0000000000000000 0x11a main.obj - .debug_frame 0x000000000000011a 0x114 Blinker.obj - -.debug_str 0x0000000000000000 0x6c6 - *(.debug_str) - .debug_str 0x0000000000000000 0x32a main.obj - 0x42a (size before relaxing) - .debug_str 0x000000000000032a 0x39c Blinker.obj - 0x49b (size before relaxing) - -.debug_loc 0x0000000000000000 0x381 - *(.debug_loc) - .debug_loc 0x0000000000000000 0xf6 main.obj - .debug_loc 0x00000000000000f6 0x28b Blinker.obj - -.debug_macinfo - *(.debug_macinfo) - -.debug_pubtypes - *(.debug_pubtypes) - -.debug_ranges 0x0000000000000000 0xc - *(.debug_ranges) - .debug_ranges 0x0000000000000000 0xc main.obj - 0x0000000000000400 PROVIDE (__stack, (ORIGIN (ram) + 0x200)) - 0x000000000000c688 PROVIDE (__data_start_rom, _etext) - 0x000000000000c692 PROVIDE (__data_end_rom, (_etext + SIZEOF (.data))) -OUTPUT(main.out elf32-msp430) diff --git a/BlinkerLaunchPad/main.obj b/BlinkerLaunchPad/main.obj deleted file mode 100644 index c95815c..0000000 --- a/BlinkerLaunchPad/main.obj +++ /dev/null diff --git a/BlinkerLaunchPad/main.out b/BlinkerLaunchPad/main.out deleted file mode 100755 index 32787a2..0000000 --- a/BlinkerLaunchPad/main.out +++ /dev/null diff --git a/BlinkerLaunchPad/makefile b/BlinkerLaunchPad/makefile deleted file mode 100644 index 1cd8ce3..0000000 --- a/BlinkerLaunchPad/makefile +++ /dev/null @@ -1,8 +0,0 @@ -EMSNAME = Blinker - -COMMON = ../../../Common/Embedded/LaunchPad -SCHEMA = ../../Schema - -OBJECTS = main.obj $(EMSNAME).obj - -include $(COMMON)/rules.mk diff --git a/BlinkerSchema/.gitignore b/BlinkerSchema/.gitignore deleted file mode 100644 index acd27f7..0000000 --- a/BlinkerSchema/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/imports diff --git a/BlinkerSchema/.project b/BlinkerSchema/.project deleted file mode 100644 index 95b9071..0000000 --- a/BlinkerSchema/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - BlinkerSchema - - - - - - com.emmoco.mcmtooling.core.mcmToolingBuilder - - - - - - com.emmoco.mcmtooling.core.mcmToolingNature - - diff --git a/BlinkerSchema/Em/Blinker-STUBS.c b/BlinkerSchema/Em/Blinker-STUBS.c deleted file mode 100644 index 00ac639..0000000 --- a/BlinkerSchema/Em/Blinker-STUBS.c +++ /dev/null @@ -1,42 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#include "Blinker.h" - -#ifdef Blinker_STUBS_ /* enables optional inclusion of application stubs */ - -/* Copy the function skeletons below into your own application source file */ - -void Blinker_connectHandler(void) { - /* TODO: application is now connected */ -} - -void Blinker_disconnectHandler(void) { - /* TODO: application is now disconnected */ -} - -void Blinker_cmd_store(Blinker_cmd_t* input) { - /* TODO: write resource 'cmd' from 'input' */ -} - -void Blinker_count_fetch(Blinker_count_t* output) { - /* TODO: read resource 'count' into 'output' */ -} - -void Blinker_count_store(Blinker_count_t* input) { - /* TODO: write resource 'count' from 'input' */ -} - -void Blinker_delay_fetch(Blinker_delay_t* output) { - /* TODO: read resource 'delay' into 'output' */ -} - -void Blinker_delay_store(Blinker_delay_t* input) { - /* TODO: write resource 'delay' from 'input' */ -} - -void Blinker_ledState_fetch(Blinker_ledState_t* output) { - /* TODO: read resource 'ledState' into 'output' */ -} - -#endif /* application stubs */ diff --git a/BlinkerSchema/Em/Blinker.c b/BlinkerSchema/Em/Blinker.c deleted file mode 100644 index 1c19cf5..0000000 --- a/BlinkerSchema/Em/Blinker.c +++ /dev/null @@ -1,526 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#include "Em_Message.h" -#include "Blinker.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define Em_Message_protocolLevel 13 - -typedef struct Em_App_Message { - uint8_t dummy[3]; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[20]; -} Em_App_Message; - -const uint8_t Em_App_hash[] = {252, 123, 209, 86, 230, 104, 211, 8, 40, 191, 19, 28, 180, 183, 223, 192, 13, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; - -const uint8_t Em_App_build[] = {24, 231, 30, 251, 69, 1, 0, 0}; - -#define Em_App_APP_RESOURCE_COUNT 4 -#define Em_App_SYS_RESOURCE_COUNT 9 - -#define Em_App_ACCEPT Blinker_accept -#define Em_App_ACTIVATEPARAMETERS Blinker_activateParameters -#define Em_App_BROADCASTOFF Blinker_broadcastOff -#define Em_App_DISCONNECT Blinker_disconnect -#define Em_App_PAIRINGON Blinker_pairingOn -#define Em_App_PAIRINGOFF Blinker_pairingOff -#define Em_App_RESET Blinker_reset -#define Em_App_SETDEVICENAME Blinker_setDeviceName -#define Em_App_START Blinker_start - -#define Em_App_CONNECTHANDLER Blinker_connectHandler -#define Em_App_DISCONNECTHANDLER Blinker_disconnectHandler - -#define Em_App_MAX_INDICATOR 2 - -/* BEGIN common code */ - -enum {Em_App_IDLE, Em_App_STARTING, Em_App_DISCONNECTED, Em_App_CONNECTED}; - -typedef struct Em_App_Indicator { - uint8_t dummy[3]; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[Em_Message_INDSIZE]; -} Em_App_Indicator; - -union { uint32_t align; Em_App_Message msg; } Em_App_msg_u; -union { uint32_t align; Em_App_Indicator ind; } Em_App_ind_u; -#define Em_App_msg Em_App_msg_u.msg -#define Em_App_ind Em_App_ind_u.ind - -void (*Em_App_pdHdlr)(void); - -const uint16_t Em_App_endian = 0x0100; - -Em_Message_Size Em_App_recvIdx; -Em_Message_Size Em_App_recvSize; -Em_Message_Size Em_App_xmitIdx; -Em_Message_Size Em_App_xmitSize; - -uint8_t Em_App_state = Em_App_IDLE; -int32_t Em_App_fileIndex = 0; -uint32_t Em_App_xmitMask = 0; - -uint8_t* Em_App_valp; -uint8_t* Em_App_bufp; -const char* Em_App_desc; - -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; -uint8_t* Em_App_outBuf = 0; - -uint8_t* _Em_Message_rxBuf = 0; -uint8_t _Em_Message_rxCnt = 0; - -uint8_t* _Em_Message_txBuf = 0; -uint8_t _Em_Message_txCnt = 0; - -#define Em_App_DEVNAME_LEN 9 -const char* Em_App_devName = 0; - -void Em_App_fetchDispatch(void); -void Em_Message_marshallToBuf(uint8_t* valp, uint8_t* bufp, const char* desc); -void Em_Message_marshallToVal(uint8_t* valp, uint8_t* bufp, const char* desc); -void Em_App_storeDispatch(void); -void Em_App_sendIndicator(Em_Message_ResId indId); -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); -void Em_App_startIndSend(void); -void Em_App_startResSend(void); -void Em_App_sysFetchDispatch(void); -void Em_App_sysStoreDispatch(void); -bool Em_App_xmitReady(Em_Message_ResId indId); - -void Em_Message_nextXmit(void) { - uint8_t key = Em_Hal_lock(); - if (Em_App_xmitMask != 0) { - uint8_t i; - uint32_t m; - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { - if (Em_App_xmitMask & m) { - Em_App_xmitMask &= ~m; - if (i == 0) { - Em_App_startResSend(); - } - else { - Em_App_sendIndicator(i - 1); - } - break; - } - } - } - Em_Hal_unlock(key); -} - -void Em_Message_restart(void) { - Em_App_START(); -} - -void Em_App_ACCEPT(bool enable) { - if (Em_App_state == Em_App_CONNECTED) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACCEPT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = enable; - Em_App_startIndSend(); -} - -void Em_App_ACTIVATEPARAMETERS(uint8_t group) { - if (Em_App_state == Em_App_IDLE || Em_App_state == Em_App_STARTING) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACTIVE_PARAMS; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = group; - Em_App_startIndSend(); -} - -void Em_App_BROADCASTOFF(void) { - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_App_DISCONNECT(void) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_state = Em_App_DISCONNECTED; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_Message_dispatch(void) { - if (Em_App_state == Em_App_IDLE) { - return; - } - switch (Em_App_msg.hdr.kind) { - case Em_Message_CONNECT: - Em_App_state = Em_App_CONNECTED; - Em_App_CONNECTHANDLER(); - break; - case Em_Message_DISCONNECT: - Em_App_state = Em_App_DISCONNECTED; - Em_App_DISCONNECTHANDLER(); - break; - case Em_Message_PAIRING_DONE: - if (Em_App_pdHdlr) { - (*Em_App_pdHdlr)(); - } - break; - case Em_Message_FETCH: - if (Em_App_msg.hdr.resId < 0x80) { - Em_App_fetchDispatch(); - } - else { - Em_App_sysFetchDispatch(); - } - break; - case Em_Message_STORE: - if (Em_App_msg.hdr.resId < 0x80) { - Em_App_storeDispatch(); - } - else { - Em_App_sysStoreDispatch(); - } - break; - } -} - -void Em_App_marshallToBuf() { - char ch; - while ((ch = *Em_App_desc++)) { - switch (ch) { - case '0' : { - *Em_App_bufp++ = 0; - break; - } - case '1' : { - *Em_App_bufp++ = *Em_App_valp & 0xFF; - break; - } - case '2' : { - uint16_t v16 = *(uint16_t*)Em_App_valp; - *Em_App_bufp++ = v16 & 0xFF; - *Em_App_bufp++ = (v16 >> 8) & 0xFF; - break; - } - case '4' : { - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; - uint32_t v32 = *(uint32_t*)Em_App_valp++; - *Em_App_bufp++ = v32 & 0xFF; - *Em_App_bufp++ = (v32 >> 8) & 0xFF; - *Em_App_bufp++ = (v32 >> 16) & 0xFF; - *Em_App_bufp++ = (v32 >> 24) & 0xFF; - break; - } - } - Em_App_valp += 1; - } -} - -void Em_App_marshallToVal() { - char ch; - while ((ch = *Em_App_desc++)) { - switch (ch) { - case '0' : { - *Em_App_valp = 0; - Em_App_bufp += 1; - break; - } - case '1' : { - *Em_App_valp = *Em_App_bufp++ & 0xFF; - break; - } - case '2' : { - uint16_t v16 = *Em_App_bufp++ & 0xFF; - v16 |= (*Em_App_bufp++ << 8); - *(uint16_t*)Em_App_valp = v16; - break; - } - case '4' : { - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; - uint32_t v32 = (uint32_t)*Em_App_bufp++ & 0xFF; - v32 |= ((uint32_t)*Em_App_bufp++ << 8); - v32 |= ((uint32_t)*Em_App_bufp++ << 16); - v32 |= ((uint32_t)*Em_App_bufp++ << 24); - *(uint32_t*)Em_App_valp++ = v32; - break; - } - } - Em_App_valp += 1; - } -} - -void Em_App_PAIRINGOFF(void(*handler)(void)) { - Em_App_PAIRINGON(0, handler); -} - -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { - if (Em_App_state != Em_App_DISCONNECTED) { - return; - } - Em_App_pdHdlr = handler; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_PAIRING; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = secs; - Em_App_startIndSend(); -} - -void Em_App_RESET(void) { - Em_Hal_reset(); - _Em_Message_rxBuf = _Em_Message_txBuf = 0; - _Em_Message_rxCnt = _Em_Message_txCnt = 0; - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; - Em_App_state = Em_App_IDLE; - Em_App_fileIndex = 0; - Em_App_xmitMask = 0; -} - -void Em_App_SETDEVICENAME(const char* name) { - Em_App_devName = name; -} - -void Em_App_START(void) { - Em_App_RESET(); - Em_App_state = Em_App_STARTING; -} - -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { - if (Em_App_state != Em_App_IDLE) { - Em_App_msg.sot = 0; - Em_App_msg.hdr.kind = kind; - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); - if (Em_App_xmitReady(0)) { - Em_App_startResSend(); - } - } -} - -void Em_App_startIndSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; - Em_App_xmitSize = Em_App_ind.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Hal_startSend(); -} - -void Em_App_startResSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; - Em_App_xmitSize = Em_App_msg.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Hal_startSend(); -} - -void Em_App_sysFetchDispatch(void) { - uint8_t size = 0; - int i, j; - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_SCHEMA_HASH: - for (i = 0; i < sizeof (Em_App_hash); i++) { - Em_App_msg.data[i] = Em_App_hash[i]; - } - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); - size = sizeof (Em_App_hash) + 1; - break; - case Em_Message_SYS_MCM_NAME: - if (Em_App_devName) { - for (i = 0; i < Em_App_DEVNAME_LEN; i++) { - if ((Em_App_msg.data[i] = Em_App_devName[i]) == 0) { - break; - } - } - for (j = i; j < Em_App_DEVNAME_LEN; j++) { - Em_App_msg.data[j] = 0; - } - size = Em_App_DEVNAME_LEN; - } - break; - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; - size = sizeof (Em_Message_protocolLevel_t); - break; - case Em_Message_SYS_EAP_BUILD_DATE: - for (i = 0; i < sizeof (Em_App_build); i++) { - Em_App_msg.data[i] = Em_App_build[i]; - } - size = sizeof (Em_App_build); - break; - case Em_Message_SYS_RESOURCE_COUNT: - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; - size = 2; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_sysStoreDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_FILE_INDEX_RESET: - Em_App_fileIndex = 0; - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -bool Em_App_xmitReady(Em_Message_ResId indId) { - uint8_t key = Em_Hal_lock(); - bool res = _Em_Message_txBuf == 0 && Em_App_xmitMask == 0; - if (!res) { - Em_App_xmitMask |= (1 << indId); - } - Em_Hal_unlock(key); - return res; -} - -/* END common code */ - -void Em_App_fetchDispatch(void) { - uint8_t size = 0; - switch (Em_App_msg.hdr.resId) { - case 0: { - break; - } - case 2: { -#ifdef Em_16BIT - Blinker_count_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "2"; - Blinker_count_fetch(&val); - Em_App_marshallToBuf(); -#else - Blinker_count_fetch((void*)Em_App_msg.data); -#endif - size = 2; - break; - } - case 3: { -#ifdef Em_16BIT - Blinker_delay_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "2"; - Blinker_delay_fetch(&val); - Em_App_marshallToBuf(); -#else - Blinker_delay_fetch((void*)Em_App_msg.data); -#endif - size = 2; - break; - } - case 4: { -#ifdef Em_16BIT - Blinker_ledState_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - Blinker_ledState_fetch(&val); - Em_App_marshallToBuf(); -#else - Blinker_ledState_fetch((void*)Em_App_msg.data); -#endif - size = 1; - break; - } - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_storeDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case 0: { - break; - } - case 1: { -#ifdef Em_16BIT - Blinker_cmd_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - Em_App_marshallToVal(); - Blinker_cmd_store(&val); -#else - Blinker_cmd_store((void*)Em_App_msg.data); -#endif - break; - } - case 2: { -#ifdef Em_16BIT - Blinker_count_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "2"; - Em_App_marshallToVal(); - Blinker_count_store(&val); -#else - Blinker_count_store((void*)Em_App_msg.data); -#endif - break; - } - case 3: { -#ifdef Em_16BIT - Blinker_delay_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "2"; - Em_App_marshallToVal(); - Blinker_delay_store(&val); -#else - Blinker_delay_store((void*)Em_App_msg.data); -#endif - break; - } - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -void Em_App_sendIndicator(Em_Message_ResId indId) { - Em_Message_Size resId = 0; - Em_Message_Size size = 0; - switch (indId) { - case 1: { -#ifdef Em_16BIT - Blinker_ledState_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_ind.data; - Em_App_desc = "1"; - Blinker_ledState_fetch(&val); - Em_App_marshallToBuf(); -#else - Blinker_ledState_fetch((Blinker_ledState_t*)&Em_App_ind.data); -#endif - resId = 4; - size = 1; - break; - } - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; - Em_App_ind.hdr.resId = resId; - Em_App_startIndSend(); -} - -void Blinker_ledState_indicate(void) { - if (Em_App_state == Em_App_CONNECTED && Em_App_xmitReady(1 + 1)) Em_App_sendIndicator(1); -} - -#ifdef __cplusplus -} -#endif - diff --git a/BlinkerSchema/Em/Blinker.h b/BlinkerSchema/Em/Blinker.h deleted file mode 100644 index f829bca..0000000 --- a/BlinkerSchema/Em/Blinker.h +++ /dev/null @@ -1,72 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#ifndef Blinker__H -#define Blinker__H - -#include "Em_Types.h" -#include "Em_Message.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------- connection callback functions implemented by the application -------- */ - -void Blinker_connectHandler(void); -void Blinker_disconnectHandler(void); - -/* -------- resource types defined in the schema -------- */ - -/* enum Cmd */ -typedef uint8_t Blinker_Cmd; -#define Blinker_START_CMD 0 -#define Blinker_STOP_CMD 1 - -/* enum LedState */ -typedef uint8_t Blinker_LedState; -#define Blinker_LED_OFF 0 -#define Blinker_LED_ON 1 - -/* -------- resource callback functions implemented by the application -------- */ - -/* resource cmd */ -typedef Blinker_Cmd Blinker_cmd_t; -extern void Blinker_cmd_store(Blinker_cmd_t* input); - -/* resource count */ -typedef int16_t Blinker_count_t; -extern void Blinker_count_fetch(Blinker_count_t* output); -extern void Blinker_count_store(Blinker_count_t* input); - -/* resource delay */ -typedef uint16_t Blinker_delay_t; -#define Blinker_delay_min 500 -#define Blinker_delay_max 2000 -#define Blinker_delay_step 100 -#define Blinker_delay_scale 1000 -extern void Blinker_delay_fetch(Blinker_delay_t* output); -extern void Blinker_delay_store(Blinker_delay_t* input); - -/* resource ledState */ -typedef Blinker_LedState Blinker_ledState_t; -extern void Blinker_ledState_fetch(Blinker_ledState_t* output); -extern void Blinker_ledState_indicate(void); /* called by the application */ - -/* -------- application functions implemented in Blinker.c -------- */ - -void Blinker_accept(bool enable); -void Blinker_activateParameters(uint8_t group); -void Blinker_broadcastOff(void); -void Blinker_disconnect(void); -void Blinker_pairingOn(uint8_t secs, void(*handler)(void)); -void Blinker_pairingOff(void(*handler)(void)); -void Blinker_reset(void); -void Blinker_setDeviceName(const char* name); -void Blinker_start(void); - -#ifdef __cplusplus -} -#endif - -#endif /* Blinker__H */ diff --git a/BlinkerSchema/Em/Em_Message.h b/BlinkerSchema/Em/Em_Message.h deleted file mode 100644 index 3bd0d58..0000000 --- a/BlinkerSchema/Em/Em_Message.h +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef Em_Message_H_ -#define Em_Message_H_ - -#include "Em_Types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------- SRT FUNCTIONS CALLED BY HAL -------- */ - -static inline bool Em_Message_addByte(uint8_t b); -extern void Em_Message_dispatch(void); -static inline bool Em_Message_getByte(uint8_t* bp); -extern void Em_Message_restart(void); -static inline bool Em_Message_startRx(void); -static inline uint8_t Em_Message_startTx(void); - - -/* -------- HAL FUNCTIONS CALLED BY SRT -------- */ - -extern uint8_t Em_Hal_lock(void); -extern void Em_Hal_reset(void); -extern void Em_Hal_startSend(void); -extern void Em_Hal_unlock(uint8_t key); -extern void Em_Hal_watchOff(void); -extern void Em_Hal_watchOn(void); - - -/* -------- MESSAGE FORMAT -------- */ - -/* protocolLevel #4 */ -#define Em_Message_INDSIZE 4 - -typedef uint8_t Em_Message_Size; -typedef uint8_t Em_Message_Kind; -/* protocolLevel #12 -- split 16-bit resId into */ -typedef uint8_t Em_Message_ResId; -typedef uint8_t Em_Message_Chan; - -#define Em_Message_NOP 0 -#define Em_Message_FETCH 1 -#define Em_Message_FETCH_DONE 2 -#define Em_Message_STORE 3 -#define Em_Message_STORE_DONE 4 -#define Em_Message_INDICATOR 5 -#define Em_Message_CONNECT 6 -#define Em_Message_DISCONNECT 7 -#define Em_Message_ECHO 8 -/* protocolLevel #3 */ -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ -#define Em_Message_PAIRING 9 -#define Em_Message_PAIRING_DONE 10 -/* protocolLevel #7 */ -#define Em_Message_OFFLINE 11 -/* protocolLevel #8 */ -#define Em_Message_ACCEPT 12 -/* protocolLevel #13 */ -#define Em_Message_START 13 -#define Em_Message_ACTIVE_PARAMS 14 - -typedef struct Em_Message_Header { - Em_Message_Size size; - Em_Message_Kind kind; - Em_Message_ResId resId; - Em_Message_Chan chan; -} Em_Message_Header; - -typedef uint16_t Em_Message_protocolLevel_t; - -/* protocolLevel #1 */ - -/* protocolLevel #10 */ -/* #define Em_Message_SYS_SCHEMA_UUID 0xFF */ - -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL 0xFE -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL 0xFD -#define Em_Message_SYS_EAP_BUILD_DATE 0xFC - -/* protocolLevel #2 */ -#define Em_Message_SYS_FILE_INDEX_RESET 0xFB - -/* protocolLevel #5 */ -#define Em_Message_SYS_SCHEMA_HASH 0xFA - -/* protocolLevel #7 */ -#define Em_Message_SYS_RESOURCE_COUNT 0xF9 - -/* protocolLevel #9 */ -#define Em_Message_SYS_MOBILE_RSSI 0xF8 - -/* protocolLevel #11 */ -#define Em_Message_SYS_MCM_DISCONNECT 0xF7 - -/* protocolLevel #13a */ -#define Em_Message_SYS_MCM_NAME 0xF5 - - -/* -------- PRIVATE -------- */ - -extern void Em_Message_nextXmit(void); - -extern uint8_t* Em_App_inBuf; -extern uint8_t* Em_App_outBuf; -extern Em_Message_Size Em_App_xmitSize; - -extern uint8_t* _Em_Message_rxBuf; -extern uint8_t _Em_Message_rxCnt; - -extern uint8_t* _Em_Message_txBuf; -extern uint8_t _Em_Message_txCnt; - -static inline bool Em_Message_addByte(uint8_t b) { - if (_Em_Message_rxCnt == 0) { - if (b == 0) { - return false; - } - _Em_Message_rxCnt = b; - } - *_Em_Message_rxBuf++ = b; - if (--_Em_Message_rxCnt == 0) { - _Em_Message_rxBuf = 0; - if (_Em_Message_txBuf == 0) { - Em_Hal_watchOff(); - } - return true; - } - else { - return false; - } -} - -static inline bool Em_Message_getByte(uint8_t* bp) { - if (_Em_Message_txBuf == 0) { - return false; - } - if (_Em_Message_txCnt == 0) { - _Em_Message_txCnt = *_Em_Message_txBuf + 1; - } - if (--_Em_Message_txCnt > 0) { - *bp = *_Em_Message_txBuf++; - return true; - } - else { - _Em_Message_txBuf = 0; - Em_App_xmitSize = 0; - Em_Message_nextXmit(); - if (_Em_Message_rxBuf == 0) { - Em_Hal_watchOff(); - } - return false; - } -} - -static inline bool Em_Message_startRx(void) { - if (_Em_Message_rxBuf == 0) { - _Em_Message_rxBuf = Em_App_inBuf; - if (_Em_Message_txBuf == 0) { - Em_Hal_watchOn(); - } - return true; - } - else { - return false; - } -} - -static inline uint8_t Em_Message_startTx(void) { - _Em_Message_txBuf = Em_App_outBuf + 1; - _Em_Message_txCnt = 0; - if (_Em_Message_rxBuf == 0) { - Em_Hal_watchOn(); - } - return 0; -} - - -#ifdef __cplusplus -} -#endif - -#endif /*Em_Message_H_*/ diff --git a/BlinkerSchema/Em/Em_Types.h b/BlinkerSchema/Em/Em_Types.h deleted file mode 100644 index d002306..0000000 --- a/BlinkerSchema/Em/Em_Types.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef Em_Types_H_ -#define Em_Types_H_ - -#ifndef Em_NOSTDBOOL -#include -#endif - -#ifndef Em_NOSTDINT -#include -#endif - -#ifdef Em_16BIT -typedef signed char int8_t; -typedef unsigned char uint8_t; -#endif - -#endif /*Em_Types_H_*/ diff --git a/BlinkerSchema/Em/blinker.json b/BlinkerSchema/Em/blinker.json deleted file mode 100644 index c806052..0000000 --- a/BlinkerSchema/Em/blinker.json +++ /dev/null @@ -1,262 +0,0 @@ -{ - "resources": { - "$eapProtocolLevel": { - "id": -3, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "count": { - "id": 2, - "align": 2, - "attributes": {"readwrite": true}, - "type": "i2", - "access": "rw", - "size": 2 - }, - "$activeGroup": { - "id": -10, - "align": 1, - "pack": 1, - "attributes": {"readwrite": true}, - "type": "E:system@emmoco.com.System/ParameterGroup", - "access": "rw", - "size": 1 - }, - "$mcmDisconnect": { - "id": -9, - "align": 1, - "attributes": {"writeonly": true}, - "type": "u1", - "access": "w", - "size": 1 - }, - "$eapBuildDate": { - "dim": 8, - "id": -4, - "align": 1, - "attributes": {"readonly": true}, - "type": "A8:u1", - "access": "r", - "size": 8 - }, - "ledState": { - "id": 4, - "align": 1, - "pack": 1, - "attributes": { - "indicator": true, - "readonly": true - }, - "type": "E:@emmoco.com.Blinker/LedState", - "access": "ir", - "size": 1 - }, - "$resourceCount": { - "id": -7, - "align": 1, - "attributes": {"readonly": true}, - "type": "S:system@emmoco.com.System/ResourceCount", - "access": "r", - "size": 2 - }, - "$schemaHash": { - "dim": 20, - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, - "cmd": { - "id": 1, - "align": 1, - "pack": 1, - "attributes": {"writeonly": true}, - "type": "E:@emmoco.com.Blinker/Cmd", - "access": "w", - "size": 1 - }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, - "delay": { - "id": 3, - "align": 2, - "pack": 4, - "attributes": {"readwrite": true}, - "type": "N:0.500000,2.000000,0.100000,3/u2/15", - "access": "rw", - "size": 2 - }, - "$fileIndexReset": { - "id": -5, - "align": 2, - "attributes": {"writeonly": true}, - "type": "i2", - "access": "w", - "size": 2 - } - }, - "resourceNamesSys": [ - "$activeGroup", - "$eapBuildDate", - "$eapProtocolLevel", - "$fileIndexReset", - "$mcmDisconnect", - "$mcmProtocolLevel", - "$mobileRssi", - "$resourceCount", - "$schemaHash" - ], - "manifest": { - "protocolLevel": 13, - "hash": [ - 252, - 123, - 209, - 86, - 230, - 104, - 211, - 8, - 40, - 191, - 19, - 28, - 180, - 183, - 223, - 192 - ], - "toolVersion": "13.4.1.201311121909", - "name": "Blinker", - "$$md5": "fc7bd156e668d30828bf131cb4b7dfc0", - "build": [ - 24, - 231, - 30, - 251, - 69, - 1, - 0, - 0 - ], - "date": "2014-05-14T16:24:37T", - "maxAlign": 2, - "maxSize": 20, - "version": "1.0.0" - }, - "resourceNames": [ - "cmd", - "count", - "delay", - "ledState", - "$mcmProtocolLevel", - "$eapProtocolLevel", - "$eapBuildDate", - "$fileIndexReset", - "$schemaHash", - "$resourceCount", - "$mobileRssi", - "$mcmDisconnect", - "$activeGroup" - ], - "attributes": { - "description": "Blinker, the hello world program for mobile control", - "version": "1.0.0" - }, - "resourceNamesApp": [ - "cmd", - "count", - "delay", - "ledState" - ], - "types": { - "@emmoco.com.Blinker/LedState": { - "values": [ - "LED_OFF", - "LED_ON" - ], - "align": 1, - "pack": 1, - "type": "E:@emmoco.com.Blinker/LedState", - "size": 1 - }, - "system@emmoco.com.System/ResourceCount": { - "packed": false, - "align": 1, - "type": "S:system@emmoco.com.System/ResourceCount", - "size": 2, - "fields": [ - { - "pad": 0, - "align": 1, - "name": "app", - "type": "u1", - "size": 1 - }, - { - "pad": 0, - "align": 1, - "name": "sys", - "type": "u1", - "size": 1 - } - ] - }, - "std:i2": { - "align": 2, - "size": 2 - }, - "std:i1": { - "align": 1, - "size": 1 - }, - "std:u1": { - "align": 1, - "size": 1 - }, - "system@emmoco.com.System/ParameterGroup": { - "values": [ - "GROUP_A", - "GROUP_B" - ], - "align": 1, - "pack": 1, - "type": "E:system@emmoco.com.System/ParameterGroup", - "size": 1 - }, - "@emmoco.com.Blinker/Cmd": { - "values": [ - "START_CMD", - "STOP_CMD" - ], - "align": 1, - "pack": 1, - "type": "E:@emmoco.com.Blinker/Cmd", - "size": 1 - }, - "std:u2": { - "align": 2, - "size": 2 - } - }, - "imports": {"@emmoco.com.Blinker": true} -} \ No newline at end of file diff --git a/BlinkerSchema/Schema-Imports/system@emmoco.com/System.ems b/BlinkerSchema/Schema-Imports/system@emmoco.com/System.ems deleted file mode 100644 index 9601635..0000000 --- a/BlinkerSchema/Schema-Imports/system@emmoco.com/System.ems +++ /dev/null @@ -1,72 +0,0 @@ -owner = "system@emmoco.com" - -schema System { - - // protocolLevel #13 - - enum ParameterGroup { - GROUP_A, GROUP_B - } - - // protocolLevel #1 - - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications - readonly - } - - uint16 $mcmProtocolLevel { - readonly - } - - uint16 $eapProtocolLevel { - readonly - } - - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber - readonly - } - - // protocolLevel #2 - - int16 $fileIndexReset { - writeonly - } - - // protocolLevel #5 - - // protocolLevel #12 -- increase size to 20 - - uint8 $schemaHash[20] { - readonly - } - - // protocolLevel #7 - - struct ResourceCount { - uint8 app - uint8 sys - } - - ResourceCount $resourceCount { - readonly - } - - // protocolLevel #9 - - int8 $mobileRssi { - readonly - } - - // protocolLevel #11 - - uint8 $mcmDisconnect { - writeonly - } - - // protocolLevel #13 - - ParameterGroup $activeGroup { - readwrite - } - -} diff --git a/BlinkerSchema/bundle.properties b/BlinkerSchema/bundle.properties deleted file mode 100644 index 9e0bbd0..0000000 --- a/BlinkerSchema/bundle.properties +++ /dev/null @@ -1,10 +0,0 @@ -# generated file - do not edit - -bundle.requires = com.emmoco.schema.translator -com.emmoco.framework.Properties.applicationDirectory = Em -com.emmoco.framework.Properties.schemaDestinationDirectory = Em -com.emmoco.framework.Properties.serverAPIToken = -com.emmoco.framework.Properties.align16 = 2 -com.emmoco.framework.Properties.align32 = 4 -com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/durex/BlinkerSchema/schema.ems -com.emmoco.framework.Properties.toolVersion = 13.4.1.201311121909 diff --git a/BlinkerSchema/imports/system@emmoco.com/System.ems b/BlinkerSchema/imports/system@emmoco.com/System.ems deleted file mode 100644 index c71c87a..0000000 --- a/BlinkerSchema/imports/system@emmoco.com/System.ems +++ /dev/null @@ -1,60 +0,0 @@ -owner = "system@emmoco.com" - -schema System { - - // protocolLevel #1 - - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications - readonly - } - - uint16 $mcmProtocolLevel { - readonly - } - - uint16 $eapProtocolLevel { - readonly - } - - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber - readonly - } - - // protocolLevel #2 - - int16 $fileIndexReset { - writeonly - } - - // protocolLevel #5 - - // protocolLevel #12 -- increase size to 20 - - uint8 $schemaHash[20] { - readonly - } - - // protocolLevel #7 - - struct ResourceCount { - uint8 app - uint8 sys - } - - ResourceCount $resourceCount { - readonly - } - - // protocolLevel #9 - - int8 $mobileRssi { - readonly - } - - // protocolLevel #11 - - uint8 $mcmDisconnect { - writeonly - } - -} diff --git a/BlinkerSchema/out/Blinker-TODO.c b/BlinkerSchema/out/Blinker-TODO.c deleted file mode 100644 index 853c108..0000000 --- a/BlinkerSchema/out/Blinker-TODO.c +++ /dev/null @@ -1,42 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#include "Blinker.h" - -#ifdef Em_Blinker_TODO /* enables optional inclusion of empty functions */ - -/* Copy the function skeletons below into your own Blinker.c source file */ - -void Blinker_connectHandler(void) { - /* TODO: application is now connected */ -} - -void Blinker_disconnectHandler(void) { - /* TODO: application is now disconnected */ -} - -void Blinker_cmd_store(Blinker_cmd_t* const input) { - /* TODO: read resource 'cmd' from 'input' */ -} - -void Blinker_count_fetch(Blinker_count_t* const output) { - /* TODO: write resource 'count' into 'output' */ -} - -void Blinker_count_store(Blinker_count_t* const input) { - /* TODO: read resource 'count' from 'input' */ -} - -void Blinker_delay_fetch(Blinker_delay_t* const output) { - /* TODO: write resource 'delay' into 'output' */ -} - -void Blinker_delay_store(Blinker_delay_t* const input) { - /* TODO: read resource 'delay' from 'input' */ -} - -void Blinker_ledState_fetch(Blinker_ledState_t* const output) { - /* TODO: write resource 'ledState' into 'output' */ -} - -#endif /* dummy file */ diff --git a/BlinkerSchema/out/Blinker.c b/BlinkerSchema/out/Blinker.c deleted file mode 100644 index af1104f..0000000 --- a/BlinkerSchema/out/Blinker.c +++ /dev/null @@ -1,348 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#include "Em_Message.h" -#include "Blinker.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define Em_Message_protocolLevel 12 - -typedef struct Em_App_Message { - uint8_t dummy; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[20]; -} Em_App_Message; - -const uint8_t Em_App_hash[] = {194, 8, 191, 173, 237, 198, 193, 165, 88, 202, 74, 246, 70, 59, 102, 128, 12, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; - -const uint8_t Em_App_build[] = {70, 123, 11, 227, 69, 1, 0, 0}; - -#define Em_App_APP_RESOURCE_COUNT 4 -#define Em_App_SYS_RESOURCE_COUNT 8 - -#define Em_App_ACCEPT Blinker_accept -#define Em_App_DISCONNECT Blinker_disconnect -#define Em_App_PAIRINGON Blinker_pairingOn -#define Em_App_PAIRINGOFF Blinker_pairingOff -#define Em_App_RESET Blinker_reset -#define Em_App_RUN Blinker_run - -#define Em_App_CONNECTHANDLER Blinker_connectHandler -#define Em_App_DISCONNECTHANDLER Blinker_disconnectHandler - -#define Em_App_MAX_INDICATOR 2 - -enum {Em_App_IDLE, Em_App_DISCONNECTED, Em_App_CONNECTED}; - -typedef struct Em_App_Indicator { - uint8_t dummy; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[Em_Message_INDSIZE]; -} Em_App_Indicator; - -void (*Em_App_pdHdlr)(void); - -const uint16_t Em_App_endian = 0x0100; - -Em_Message_Size Em_App_recvIdx; -Em_Message_Size Em_App_recvSize; -Em_Message_Size Em_App_xmitIdx; -Em_Message_Size Em_App_xmitSize; - -uint8_t Em_App_state = Em_App_IDLE; -Em_App_Message Em_App_msg; -Em_App_Indicator Em_App_ind; -bool Em_App_moreData = false; -bool Em_App_readIdle = true; -int32_t Em_App_fileIndex; -uint32_t Em_App_xmitMask; - -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; -uint8_t* Em_App_outBuf; - -void Em_App_fetchDispatch(void); -void Em_App_storeDispatch(void); -void Em_App_sendIndicator(Em_Message_ResId indId); -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); -void Em_App_startIndSend(void); -void Em_App_startResSend(void); -void Em_App_sysFetchDispatch(void); -void Em_App_sysStoreDispatch(void); -bool Em_App_xmitReady(Em_Message_ResId indId); - -bool Em_Message_addByte(uint8_t b) { - if (Em_App_readIdle && b) { - Em_App_recvSize = Em_App_inBuf[0] = b; - Em_App_recvIdx = 1; - Em_App_readIdle = false; - return false; - } - Em_App_inBuf[Em_App_recvIdx++] = b; - if (Em_App_recvIdx < Em_App_recvSize) { - return false; - } - Em_App_readIdle = true; - return true; -} - -bool Em_Message_getByte(uint8_t* bp) { - uint8_t key = Em_Message_lock(); - Em_App_moreData = (Em_App_xmitSize != 0); - if (!Em_App_moreData && (Em_App_xmitMask != 0)) { - uint8_t i; - uint32_t m; - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { - if (Em_App_xmitMask & m) { - Em_App_xmitMask &= ~m; - if (i == 0) { - Em_App_startResSend(); - } - else { - Em_App_sendIndicator(i); - } - break; - } - } - Em_Message_unlock(key); - return false; - } - else if (Em_App_moreData) { - *bp = Em_App_outBuf[Em_App_xmitIdx++]; - Em_App_xmitSize -= 1; - } - Em_Message_unlock(key); - return Em_App_moreData; -} - -void Em_App_ACCEPT(bool enable) { - if (Em_App_state == Em_App_CONNECTED) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACCEPT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = enable; - Em_App_startIndSend(); -} - -void Em_App_DISCONNECT(void) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_state = Em_App_DISCONNECTED; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_Message_dispatch(void) { - if (Em_App_state == Em_App_IDLE) { - return; - } - switch (Em_App_msg.hdr.kind) { - case Em_Message_CONNECT: - Em_App_state = Em_App_CONNECTED; - Em_App_CONNECTHANDLER(); - break; - case Em_Message_DISCONNECT: - Em_App_state = Em_App_DISCONNECTED; - Em_App_DISCONNECTHANDLER(); - break; - case Em_Message_PAIRING_DONE: - if (Em_App_pdHdlr) { - (*Em_App_pdHdlr)(); - } - break; - case Em_Message_FETCH: - if (Em_App_msg.hdr.resId > 0) { - Em_App_fetchDispatch(); - } - else { - Em_App_sysFetchDispatch(); - } - break; - case Em_Message_STORE: - if (Em_App_msg.hdr.resId > 0) { - Em_App_storeDispatch(); - } - else { - Em_App_sysStoreDispatch(); - } - break; - } -} - -void Em_App_PAIRINGOFF(void(*handler)(void)) { - Em_App_PAIRINGON(0, handler); -} - -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { - if (Em_App_state != Em_App_DISCONNECTED) { - return; - } - Em_App_pdHdlr = handler; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_PAIRING; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = secs; - Em_App_startIndSend(); -} - -void Em_App_RESET(void) { - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; - Em_App_state = Em_App_IDLE; - Em_App_moreData = false; - Em_App_readIdle = true; - Em_App_fileIndex = 0; - Em_App_xmitMask = 0; -} - -void Em_App_RUN(void) { - Em_App_state = Em_App_DISCONNECTED; -} - -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_msg.sot = 0; - Em_App_msg.hdr.kind = kind; - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); - if (Em_App_xmitReady(0)) { - Em_App_startResSend(); - } -} - -void Em_App_startIndSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; - Em_App_xmitSize = Em_App_ind.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Message_startSend(); -} - -void Em_App_startResSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; - Em_App_xmitSize = Em_App_msg.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Message_startSend(); -} - -void Em_App_sysFetchDispatch(void) { - uint8_t size = 0; - int i; - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_SCHEMA_HASH: - for (i = 0; i < sizeof (Em_App_hash); i++) { - Em_App_msg.data[i] = Em_App_hash[i]; - } - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); - size = sizeof (Em_App_hash) + 1; - break; - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; - size = sizeof (Em_Message_protocolLevel_t); - break; - case Em_Message_SYS_EAP_BUILD_DATE: - for (i = 0; i < sizeof (Em_App_build); i++) { - Em_App_msg.data[i] = Em_App_build[i]; - } - size = sizeof (Em_App_build); - break; - case Em_Message_SYS_RESOURCE_COUNT: - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; - size = 2; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_sysStoreDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_FILE_INDEX_RESET: - Em_App_fileIndex = 0; - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -bool Em_App_xmitReady(Em_Message_ResId indId) { - uint8_t key = Em_Message_lock(); - bool res = !Em_App_moreData && Em_App_xmitMask == 0; - if (!res) { - Em_App_xmitMask |= (1 << indId); - } - Em_Message_unlock(key); - return res; -} - -void Em_App_fetchDispatch(void) { - uint8_t size = 0; - switch (Em_App_msg.hdr.resId) { - case 0: - break; - case 2: - Blinker_count_fetch((Blinker_count_t*)Em_App_msg.data); - size = 2; - break; - case 3: - Blinker_delay_fetch((Blinker_delay_t*)Em_App_msg.data); - size = 2; - break; - case 4: - Blinker_ledState_fetch((Blinker_ledState_t*)Em_App_msg.data); - size = 1; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_storeDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case 0: - break; - case 1: - Blinker_cmd_store((Blinker_cmd_t*)Em_App_msg.data); - break; - case 2: - Blinker_count_store((Blinker_count_t*)Em_App_msg.data); - break; - case 3: - Blinker_delay_store((Blinker_delay_t*)Em_App_msg.data); - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -void Em_App_sendIndicator(Em_Message_ResId indId) { - Em_Message_Size resId = 0; - Em_Message_Size size = 0; - switch (indId) { - case 1: - Blinker_ledState_fetch((Blinker_ledState_t*)&Em_App_ind.data); - resId = 4; - size = 1; - break; -} - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; - Em_App_ind.hdr.resId = resId; - Em_App_startIndSend(); -} - -void Blinker_ledState_indicate(void) { - if (Em_App_state != Em_App_IDLE && Em_App_xmitReady(1)) Em_App_sendIndicator(1); -} - -#ifdef __cplusplus -} -#endif - diff --git a/BlinkerSchema/out/Blinker.h b/BlinkerSchema/out/Blinker.h deleted file mode 100644 index 9507855..0000000 --- a/BlinkerSchema/out/Blinker.h +++ /dev/null @@ -1,61 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#ifndef Blinker__H -#define Blinker__H - -#include "Em_Types.h" -#include "Em_Message.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* enum Cmd */ -typedef uint8_t Blinker_Cmd; -#define Blinker_START_CMD 0 -#define Blinker_STOP_CMD 1 - -/* enum LedState */ -typedef uint8_t Blinker_LedState; -#define Blinker_LED_OFF 0 -#define Blinker_LED_ON 1 - -/* resource cmd */ -typedef Blinker_Cmd Blinker_cmd_t; -extern void Blinker_cmd_store(Blinker_cmd_t* const input); - -/* resource count */ -typedef int16_t Blinker_count_t; -extern void Blinker_count_fetch(Blinker_count_t* const output); -extern void Blinker_count_store(Blinker_count_t* const input); - -/* resource delay */ -typedef uint16_t Blinker_delay_t; -#define Blinker_delay_min 500 -#define Blinker_delay_max 2000 -#define Blinker_delay_step 100 -extern void Blinker_delay_fetch(Blinker_delay_t* const output); -extern void Blinker_delay_store(Blinker_delay_t* const input); - -/* resource ledState */ -typedef Blinker_LedState Blinker_ledState_t; -extern void Blinker_ledState_fetch(Blinker_ledState_t* const output); -extern void Blinker_ledState_indicate(void); - -void Blinker_reset(void); -void Blinker_run(void); - -void Blinker_accept(bool enable); -void Blinker_disconnect(void); -void Blinker_pairingOn(uint8_t secs, void(*handler)(void)); -void Blinker_pairingOff(void(*handler)(void)); - -void Blinker_connectHandler(void); -void Blinker_disconnectHandler(void); - -#ifdef __cplusplus -} -#endif - -#endif /* Blinker__H */ diff --git a/BlinkerSchema/out/Blinker.zip b/BlinkerSchema/out/Blinker.zip deleted file mode 100644 index 01c76cd..0000000 --- a/BlinkerSchema/out/Blinker.zip +++ /dev/null diff --git a/BlinkerSchema/out/Em_Message.h b/BlinkerSchema/out/Em_Message.h deleted file mode 100644 index dd64233..0000000 --- a/BlinkerSchema/out/Em_Message.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef Em_Message_H_ -#define Em_Message_H_ - -#include "Em_Types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* protocolLevel #4 */ -#define Em_Message_INDSIZE 4 - -typedef uint8_t Em_Message_Size; -typedef uint8_t Em_Message_Kind; -/* protocolLevel #12 -- split 16-bit resId into */ -typedef int8_t Em_Message_ResId; -typedef uint8_t Em_Message_Chan; - -#define Em_Message_NOP 0 -#define Em_Message_FETCH 1 -#define Em_Message_FETCH_DONE 2 -#define Em_Message_STORE 3 -#define Em_Message_STORE_DONE 4 -#define Em_Message_INDICATOR 5 -#define Em_Message_CONNECT 6 -#define Em_Message_DISCONNECT 7 -#define Em_Message_ECHO 8 -/* protocolLevel #3 */ -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ -#define Em_Message_PAIRING 9 -#define Em_Message_PAIRING_DONE 10 -/* protocolLevel #7 */ -#define Em_Message_OFFLINE 11 -/* protocolLevel #8 */ -#define Em_Message_ACCEPT 12 - -typedef struct Em_Message_Header { - Em_Message_Size size; - Em_Message_Kind kind; - Em_Message_ResId resId; - Em_Message_Chan chan; -} Em_Message_Header; - -typedef uint16_t Em_Message_protocolLevel_t; - -/* protocolLevel #1 */ - -/* protocolLevel #10 */ -/* #define Em_Message_SYS_SCHEMA_UUID -1 */ - -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL -2 -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL -3 -#define Em_Message_SYS_EAP_BUILD_DATE -4 - -/* protocolLevel #2 */ -#define Em_Message_SYS_FILE_INDEX_RESET -5 - -/* protocolLevel #5 */ -#define Em_Message_SYS_SCHEMA_HASH -6 - -/* protocolLevel #7 */ -#define Em_Message_SYS_RESOURCE_COUNT -7 - -/* protocolLevel #9 */ -#define Em_Message_SYS_MOBILE_RSSI -8 - -/* protocolLevel #11 */ -#define Em_Message_SYS_MCM_DISCONNECT -9 - -extern void Em_Message_init(void); - -extern bool Em_Message_addByte(uint8_t b); -extern void Em_Message_dispatch(void); -extern bool Em_Message_getByte(uint8_t *bp); -extern uint8_t Em_Message_lock(void); -extern void Em_Message_startSend(void); -extern void Em_Message_unlock(uint8_t key); - -#ifdef __cplusplus -} -#endif - -#endif /*Em_Message_H_*/ diff --git a/BlinkerSchema/out/Em_Types.h b/BlinkerSchema/out/Em_Types.h deleted file mode 100644 index a221d54..0000000 --- a/BlinkerSchema/out/Em_Types.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Em_Types_H_ -#define Em_Types_H_ - -#ifndef EM_NOSTDBOOL -#include -#endif - -#ifndef EM_NOSTDINT -#include -#endif - -#endif /*Em_Types_H_*/ diff --git a/BlinkerSchema/out/blinker.json b/BlinkerSchema/out/blinker.json deleted file mode 100644 index 76eddd4..0000000 --- a/BlinkerSchema/out/blinker.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "resources": { - "$schemaHash": { - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, - "$eapProtocolLevel": { - "id": -3, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "cmd": { - "id": 1, - "align": 1, - "attributes": {"writeonly": true}, - "type": "E:@emmoco.com.Blinker/Cmd", - "access": "w", - "size": 1 - }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "count": { - "id": 2, - "align": 2, - "attributes": {"readwrite": true}, - "type": "i2", - "access": "rw", - "size": 2 - }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, - "$mcmDisconnect": { - "id": -9, - "align": 1, - "attributes": {"writeonly": true}, - "type": "u1", - "access": "w", - "size": 1 - }, - "delay": { - "id": 3, - "align": 2, - "attributes": {"readwrite": true}, - "type": "N:0.500000,2.000000,0.100000,3/u2", - "access": "rw", - "size": 2 - }, - "$eapBuildDate": { - "id": -4, - "align": 1, - "attributes": {"readonly": true}, - "type": "A8:u1", - "access": "r", - "size": 8 - }, - "$resourceCount": { - "id": -7, - "align": 1, - "attributes": {"readonly": true}, - "type": "S:system@emmoco.com.System/ResourceCount", - "access": "r", - "size": 2 - }, - "ledState": { - "id": 4, - "align": 1, - "attributes": { - "indicator": true, - "readonly": true - }, - "type": "E:@emmoco.com.Blinker/LedState", - "access": "ir", - "size": 1 - }, - "$fileIndexReset": { - "id": -5, - "align": 2, - "attributes": {"writeonly": true}, - "type": "i2", - "access": "w", - "size": 2 - } - }, - "resourceNamesSys": [ - "$eapBuildDate", - "$eapProtocolLevel", - "$fileIndexReset", - "$mcmDisconnect", - "$mcmProtocolLevel", - "$mobileRssi", - "$resourceCount", - "$schemaHash" - ], - "manifest": { - "protocolLevel": 12, - "hash": [ - 194, - 8, - 191, - 173, - 237, - 198, - 193, - 165, - 88, - 202, - 74, - 246, - 70, - 59, - 102, - 128 - ], - "toolVersion": "12.0.0.201211010336", - "name": "Blinker", - "$$md5": "73d98dc6eb4c17eea377d5969c0e49d2", - "build": [ - 70, - 123, - 11, - 227, - 69, - 1, - 0, - 0 - ], - "date": "2014-05-10T00:12:31T", - "maxAlign": 2, - "maxSize": 20, - "version": "1.0.0" - }, - "resourceNames": [ - "cmd", - "count", - "delay", - "ledState", - "$mcmProtocolLevel", - "$eapProtocolLevel", - "$eapBuildDate", - "$fileIndexReset", - "$schemaHash", - "$resourceCount", - "$mobileRssi", - "$mcmDisconnect" - ], - "attributes": { - "description": "Blinker, the hello world program for mobile control", - "version": "1.0.0" - }, - "types": { - "@emmoco.com.Blinker/LedState": { - "values": [ - "LED_OFF", - "LED_ON" - ], - "align": 1, - "type": "E:@emmoco.com.Blinker/LedState", - "size": 1 - }, - "system@emmoco.com.System/ResourceCount": { - "align": 1, - "type": "S:system@emmoco.com.System/ResourceCount", - "size": 2, - "fields": [ - { - "pad": 0, - "align": 1, - "name": "app", - "type": "u1", - "size": 1 - }, - { - "pad": 0, - "align": 1, - "name": "sys", - "type": "u1", - "size": 1 - } - ] - }, - "std:i2": { - "align": 2, - "size": 2 - }, - "std:i1": { - "align": 1, - "size": 1 - }, - "std:u1": { - "align": 1, - "size": 1 - }, - "@emmoco.com.Blinker/Cmd": { - "values": [ - "START_CMD", - "STOP_CMD" - ], - "align": 1, - "type": "E:@emmoco.com.Blinker/Cmd", - "size": 1 - }, - "std:u2": { - "align": 2, - "size": 2 - } - }, - "resourceNamesApp": [ - "cmd", - "count", - "delay", - "ledState" - ], - "imports": {"@emmoco.com.Blinker": true} -} \ No newline at end of file diff --git a/BlinkerSchema/schema.ems b/BlinkerSchema/schema.ems deleted file mode 100644 index 245f444..0000000 --- a/BlinkerSchema/schema.ems +++ /dev/null @@ -1,32 +0,0 @@ -version = "1.0.0" -description = "Blinker, the hello world program for mobile control" - -schema Blinker { - - /* -------- resource cmd -------- */ - enum Cmd { - START_CMD, STOP_CMD - } - Cmd cmd { - writeonly - } - - /* -------- resource count -------- */ - int16 count { - readwrite - } - - /* -------- resource delay -------- */ - num <0.5, 2.0, 0.100> delay { - readwrite - } - - /* -------- resource ledState -------- */ - enum LedState { - LED_OFF, LED_ON - } - LedState ledState { - readonly - indicator - } -} diff --git a/CommonLaunchPad/.externalToolConfigurations/LaunchPad Application.launch b/CommonLaunchPad/.externalToolConfigurations/LaunchPad Application.launch deleted file mode 100644 index a43f38b..0000000 --- a/CommonLaunchPad/.externalToolConfigurations/LaunchPad Application.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/CommonLaunchPad/rules.mk b/CommonLaunchPad/rules.mk deleted file mode 100644 index d8b65a3..0000000 --- a/CommonLaunchPad/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ -MCU = msp430g2553 - -CC = msp430-gcc -OBJCOPY = msp430-objcopy -SIZE = msp430-size -MSPDEBUG = mspdebug -MSP430FLASHER = MSP430Flasher -EMBUILDER = #em-builder -COPTS = -Os -Wall -fno-strict-aliasing -c -g -mmcu=$(MCU) -LDOPTS = -mmcu=$(MCU) -Wl,-Map=main.map - -EMSOUT = $(SCHEMA)/out -RMFILES = *.out *.map *.hex *.obj -CFLAGS = -I$(COMMON) -I$(EMSOUT) $(COPTS) -LDFLAGS = $(LDOPTS) -VPATH = $(COMMON) -OUTFILE = main.out - -all: $(OUTFILE) - -ifeq (,$(findstring Windows,$(OS))) -load: out-check - $(MSPDEBUG) rf2500 "prog $(OUTFILE)" 2>&1 -else -load: $(OUTFILE:.out=.hex) - $(MSP430FLASHER) -i USB -m AUTO -e ERASE_MAIN -n $(MCU) -w $< -v -z [VCC] -g -endif - -$(OUTFILE): $(OBJECTS) - $(CC) $(LDFLAGS) -o $@ $^ - $(SIZE) $@ - -%.hex: out-check - $(OBJCOPY) -O ihex $(@:.hex=.out) $@ - -%.obj: %.c $(EMSOUT)/$(EMSNAME).h - $(CC) $(CFLAGS) -o $@ $< - -$(EMSNAME).obj: $(EMSOUT)/$(EMSNAME).c $(EMSOUT)/$(EMSNAME).h - $(CC) $(CFLAGS) -o $@ $< - -$(EMSOUT)/$(EMSNAME).h: $(SCHEMA)/schema.ems - $(EMBUILDER) -v --root=$(&2 - @exit 1 -endif - -.PHONY: all load clean local-clean out-check diff --git a/DUREX Vendor Control/CommunicationProtocol.m b/DUREX Vendor Control/CommunicationProtocol.m index 517b656..3781449 100644 --- a/DUREX Vendor Control/CommunicationProtocol.m +++ b/DUREX Vendor Control/CommunicationProtocol.m @@ -129,7 +129,7 @@ numBytes = remainingBytes; remainingBytes = 0; } - [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"data" onSuccess:^ + [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"numBytes" onSuccess:^ { status = TRUE; } diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index b2c0e25..3909138 100644 --- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate +++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 57e6d72..0c56aef 100644 --- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -25,7 +25,7 @@ symbolName = "+[CommunicationProtocol sharedProtocol]" moduleName = "DUREX Vendor Control" urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" - timestampString = "426429770.784755" + timestampString = "428340358.431629" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "20" @@ -39,7 +39,7 @@ symbolName = "__39+[CommunicationProtocol sharedProtocol]_block_invoke" moduleName = "DUREX Vendor Control" urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" - timestampString = "426429770.78569" + timestampString = "428340358.432031" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "20" diff --git a/DUREX/.project b/DUREX/.project deleted file mode 100644 index 120fd18..0000000 --- a/DUREX/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - DUREX - - - - - - com.emmoco.mcmtooling.core.mcmToolingBuilder - - - - - - com.emmoco.mcmtooling.core.mcmToolingNature - - diff --git a/DUREX/Em/DUREX-STUBS.c b/DUREX/Em/DUREX-STUBS.c deleted file mode 100644 index 4d12809..0000000 --- a/DUREX/Em/DUREX-STUBS.c +++ /dev/null @@ -1,46 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#include "DUREX.h" - -#ifdef DUREX_STUBS_ /* enables optional inclusion of application stubs */ - -/* Copy the function skeletons below into your own application source file */ - -void DUREX_connectHandler(void) { - /* TODO: application is now connected */ -} - -void DUREX_disconnectHandler(void) { - /* TODO: application is now disconnected */ -} - -void DUREX_numBytes_fetch(DUREX_numBytes_t* output) { - /* TODO: read resource 'numBytes' into 'output' */ -} - -void DUREX_numBytes_store(DUREX_numBytes_t* input) { - /* TODO: write resource 'numBytes' from 'input' */ -} - -void DUREX_data_fetch(DUREX_data_t output) { - /* TODO: read resource 'data' into 'output' */ -} - -void DUREX_data_store(DUREX_data_t input) { - /* TODO: write resource 'data' from 'input' */ -} - -void DUREX_numPackets_fetch(DUREX_numPackets_t* output) { - /* TODO: read resource 'numPackets' into 'output' */ -} - -void DUREX_numPackets_store(DUREX_numPackets_t* input) { - /* TODO: write resource 'numPackets' from 'input' */ -} - -void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* output) { - /* TODO: read resource 'messageAvailable' into 'output' */ -} - -#endif /* application stubs */ diff --git a/DUREX/Em/DUREX.c b/DUREX/Em/DUREX.c deleted file mode 100644 index 8ee047a..0000000 --- a/DUREX/Em/DUREX.c +++ /dev/null @@ -1,540 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#include "Em_Message.h" -#include "DUREX.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define Em_Message_protocolLevel 13 - -typedef struct Em_App_Message { - uint8_t dummy[3]; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[229]; -} Em_App_Message; - -const uint8_t Em_App_hash[] = {28, 106, 83, 11, 248, 159, 192, 243, 66, 193, 233, 148, 55, 208, 191, 77, 13, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; - -const uint8_t Em_App_build[] = {208, 202, 48, 251, 69, 1, 0, 0}; - -#define Em_App_APP_RESOURCE_COUNT 4 -#define Em_App_SYS_RESOURCE_COUNT 9 - -#define Em_App_ACCEPT DUREX_accept -#define Em_App_ACTIVATEPARAMETERS DUREX_activateParameters -#define Em_App_BROADCASTOFF DUREX_broadcastOff -#define Em_App_DISCONNECT DUREX_disconnect -#define Em_App_PAIRINGON DUREX_pairingOn -#define Em_App_PAIRINGOFF DUREX_pairingOff -#define Em_App_RESET DUREX_reset -#define Em_App_SETDEVICENAME DUREX_setDeviceName -#define Em_App_START DUREX_start - -#define Em_App_CONNECTHANDLER DUREX_connectHandler -#define Em_App_DISCONNECTHANDLER DUREX_disconnectHandler - -#define Em_App_MAX_INDICATOR 2 - -/* BEGIN common code */ - -enum {Em_App_IDLE, Em_App_STARTING, Em_App_DISCONNECTED, Em_App_CONNECTED}; - -typedef struct Em_App_Indicator { - uint8_t dummy[3]; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[Em_Message_INDSIZE]; -} Em_App_Indicator; - -union { uint32_t align; Em_App_Message msg; } Em_App_msg_u; -union { uint32_t align; Em_App_Indicator ind; } Em_App_ind_u; -#define Em_App_msg Em_App_msg_u.msg -#define Em_App_ind Em_App_ind_u.ind - -void (*Em_App_pdHdlr)(void); - -const uint16_t Em_App_endian = 0x0100; - -Em_Message_Size Em_App_recvIdx; -Em_Message_Size Em_App_recvSize; -Em_Message_Size Em_App_xmitIdx; -Em_Message_Size Em_App_xmitSize; - -uint8_t Em_App_state = Em_App_IDLE; -int32_t Em_App_fileIndex = 0; -uint32_t Em_App_xmitMask = 0; - -uint8_t* Em_App_valp; -uint8_t* Em_App_bufp; -const char* Em_App_desc; - -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; -uint8_t* Em_App_outBuf = 0; - -uint8_t* _Em_Message_rxBuf = 0; -uint8_t _Em_Message_rxCnt = 0; - -uint8_t* _Em_Message_txBuf = 0; -uint8_t _Em_Message_txCnt = 0; - -#define Em_App_DEVNAME_LEN 9 -const char* Em_App_devName = 0; - -void Em_App_fetchDispatch(void); -void Em_Message_marshallToBuf(uint8_t* valp, uint8_t* bufp, const char* desc); -void Em_Message_marshallToVal(uint8_t* valp, uint8_t* bufp, const char* desc); -void Em_App_storeDispatch(void); -void Em_App_sendIndicator(Em_Message_ResId indId); -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); -void Em_App_startIndSend(void); -void Em_App_startResSend(void); -void Em_App_sysFetchDispatch(void); -void Em_App_sysStoreDispatch(void); -bool Em_App_xmitReady(Em_Message_ResId indId); - -void Em_Message_nextXmit(void) { - uint8_t key = Em_Hal_lock(); - if (Em_App_xmitMask != 0) { - uint8_t i; - uint32_t m; - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { - if (Em_App_xmitMask & m) { - Em_App_xmitMask &= ~m; - if (i == 0) { - Em_App_startResSend(); - } - else { - Em_App_sendIndicator(i - 1); - } - break; - } - } - } - Em_Hal_unlock(key); -} - -void Em_Message_restart(void) { - Em_App_START(); -} - -void Em_App_ACCEPT(bool enable) { - if (Em_App_state == Em_App_CONNECTED) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACCEPT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = enable; - Em_App_startIndSend(); -} - -void Em_App_ACTIVATEPARAMETERS(uint8_t group) { - if (Em_App_state == Em_App_IDLE || Em_App_state == Em_App_STARTING) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACTIVE_PARAMS; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = group; - Em_App_startIndSend(); -} - -void Em_App_BROADCASTOFF(void) { - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_App_DISCONNECT(void) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_state = Em_App_DISCONNECTED; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_Message_dispatch(void) { - if (Em_App_state == Em_App_IDLE) { - return; - } - switch (Em_App_msg.hdr.kind) { - case Em_Message_CONNECT: - Em_App_state = Em_App_CONNECTED; - Em_App_CONNECTHANDLER(); - break; - case Em_Message_DISCONNECT: - Em_App_state = Em_App_DISCONNECTED; - Em_App_DISCONNECTHANDLER(); - break; - case Em_Message_PAIRING_DONE: - if (Em_App_pdHdlr) { - (*Em_App_pdHdlr)(); - } - break; - case Em_Message_FETCH: - if (Em_App_msg.hdr.resId < 0x80) { - Em_App_fetchDispatch(); - } - else { - Em_App_sysFetchDispatch(); - } - break; - case Em_Message_STORE: - if (Em_App_msg.hdr.resId < 0x80) { - Em_App_storeDispatch(); - } - else { - Em_App_sysStoreDispatch(); - } - break; - } -} - -void Em_App_marshallToBuf() { - char ch; - while ((ch = *Em_App_desc++)) { - switch (ch) { - case '0' : { - *Em_App_bufp++ = 0; - break; - } - case '1' : { - *Em_App_bufp++ = *Em_App_valp & 0xFF; - break; - } - case '2' : { - uint16_t v16 = *(uint16_t*)Em_App_valp; - *Em_App_bufp++ = v16 & 0xFF; - *Em_App_bufp++ = (v16 >> 8) & 0xFF; - break; - } - case '4' : { - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; - uint32_t v32 = *(uint32_t*)Em_App_valp++; - *Em_App_bufp++ = v32 & 0xFF; - *Em_App_bufp++ = (v32 >> 8) & 0xFF; - *Em_App_bufp++ = (v32 >> 16) & 0xFF; - *Em_App_bufp++ = (v32 >> 24) & 0xFF; - break; - } - } - Em_App_valp += 1; - } -} - -void Em_App_marshallToVal() { - char ch; - while ((ch = *Em_App_desc++)) { - switch (ch) { - case '0' : { - *Em_App_valp = 0; - Em_App_bufp += 1; - break; - } - case '1' : { - *Em_App_valp = *Em_App_bufp++ & 0xFF; - break; - } - case '2' : { - uint16_t v16 = *Em_App_bufp++ & 0xFF; - v16 |= (*Em_App_bufp++ << 8); - *(uint16_t*)Em_App_valp = v16; - break; - } - case '4' : { - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; - uint32_t v32 = (uint32_t)*Em_App_bufp++ & 0xFF; - v32 |= ((uint32_t)*Em_App_bufp++ << 8); - v32 |= ((uint32_t)*Em_App_bufp++ << 16); - v32 |= ((uint32_t)*Em_App_bufp++ << 24); - *(uint32_t*)Em_App_valp++ = v32; - break; - } - } - Em_App_valp += 1; - } -} - -void Em_App_PAIRINGOFF(void(*handler)(void)) { - Em_App_PAIRINGON(0, handler); -} - -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { - if (Em_App_state != Em_App_DISCONNECTED) { - return; - } - Em_App_pdHdlr = handler; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_PAIRING; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = secs; - Em_App_startIndSend(); -} - -void Em_App_RESET(void) { - Em_Hal_reset(); - _Em_Message_rxBuf = _Em_Message_txBuf = 0; - _Em_Message_rxCnt = _Em_Message_txCnt = 0; - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; - Em_App_state = Em_App_IDLE; - Em_App_fileIndex = 0; - Em_App_xmitMask = 0; -} - -void Em_App_SETDEVICENAME(const char* name) { - Em_App_devName = name; -} - -void Em_App_START(void) { - Em_App_RESET(); - Em_App_state = Em_App_STARTING; -} - -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { - if (Em_App_state != Em_App_IDLE) { - Em_App_msg.sot = 0; - Em_App_msg.hdr.kind = kind; - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); - if (Em_App_xmitReady(0)) { - Em_App_startResSend(); - } - } -} - -void Em_App_startIndSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; - Em_App_xmitSize = Em_App_ind.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Hal_startSend(); -} - -void Em_App_startResSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; - Em_App_xmitSize = Em_App_msg.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Hal_startSend(); -} - -void Em_App_sysFetchDispatch(void) { - uint8_t size = 0; - int i, j; - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_SCHEMA_HASH: - for (i = 0; i < sizeof (Em_App_hash); i++) { - Em_App_msg.data[i] = Em_App_hash[i]; - } - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); - size = sizeof (Em_App_hash) + 1; - break; - case Em_Message_SYS_MCM_NAME: - if (Em_App_devName) { - for (i = 0; i < Em_App_DEVNAME_LEN; i++) { - if ((Em_App_msg.data[i] = Em_App_devName[i]) == 0) { - break; - } - } - for (j = i; j < Em_App_DEVNAME_LEN; j++) { - Em_App_msg.data[j] = 0; - } - size = Em_App_DEVNAME_LEN; - } - break; - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; - size = sizeof (Em_Message_protocolLevel_t); - break; - case Em_Message_SYS_EAP_BUILD_DATE: - for (i = 0; i < sizeof (Em_App_build); i++) { - Em_App_msg.data[i] = Em_App_build[i]; - } - size = sizeof (Em_App_build); - break; - case Em_Message_SYS_RESOURCE_COUNT: - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; - size = 2; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_sysStoreDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_FILE_INDEX_RESET: - Em_App_fileIndex = 0; - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -bool Em_App_xmitReady(Em_Message_ResId indId) { - uint8_t key = Em_Hal_lock(); - bool res = _Em_Message_txBuf == 0 && Em_App_xmitMask == 0; - if (!res) { - Em_App_xmitMask |= (1 << indId); - } - Em_Hal_unlock(key); - return res; -} - -/* END common code */ - -void Em_App_fetchDispatch(void) { - uint8_t size = 0; - switch (Em_App_msg.hdr.resId) { - case 0: { - break; - } - case 1: { -#ifdef Em_16BIT - DUREX_numBytes_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - DUREX_numBytes_fetch(&val); - Em_App_marshallToBuf(); -#else - DUREX_numBytes_fetch((void*)Em_App_msg.data); -#endif - size = 1; - break; - } - case 2: { -#ifdef Em_16BIT - DUREX_data_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "*\xe5[1]"; - DUREX_data_fetch(&val); - Em_App_marshallToBuf(); -#else - DUREX_data_fetch((void*)Em_App_msg.data); -#endif - size = 229; - break; - } - case 3: { -#ifdef Em_16BIT - DUREX_numPackets_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - DUREX_numPackets_fetch(&val); - Em_App_marshallToBuf(); -#else - DUREX_numPackets_fetch((void*)Em_App_msg.data); -#endif - size = 1; - break; - } - case 4: { -#ifdef Em_16BIT - DUREX_messageAvailable_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - DUREX_messageAvailable_fetch(&val); - Em_App_marshallToBuf(); -#else - DUREX_messageAvailable_fetch((void*)Em_App_msg.data); -#endif - size = 1; - break; - } - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_storeDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case 0: { - break; - } - case 1: { -#ifdef Em_16BIT - DUREX_numBytes_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - Em_App_marshallToVal(); - DUREX_numBytes_store(&val); -#else - DUREX_numBytes_store((void*)Em_App_msg.data); -#endif - break; - } - case 2: { -#ifdef Em_16BIT - DUREX_data_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "*\xe5[1]"; - Em_App_marshallToVal(); - DUREX_data_store(&val); -#else - DUREX_data_store((void*)Em_App_msg.data); -#endif - break; - } - case 3: { -#ifdef Em_16BIT - DUREX_numPackets_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_msg.data; - Em_App_desc = "1"; - Em_App_marshallToVal(); - DUREX_numPackets_store(&val); -#else - DUREX_numPackets_store((void*)Em_App_msg.data); -#endif - break; - } - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -void Em_App_sendIndicator(Em_Message_ResId indId) { - Em_Message_Size resId = 0; - Em_Message_Size size = 0; - switch (indId) { - case 1: { -#ifdef Em_16BIT - DUREX_messageAvailable_t val; - Em_App_valp = (uint8_t*)&val; - Em_App_bufp = Em_App_ind.data; - Em_App_desc = "1"; - DUREX_messageAvailable_fetch(&val); - Em_App_marshallToBuf(); -#else - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)&Em_App_ind.data); -#endif - resId = 4; - size = 1; - break; - } - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; - Em_App_ind.hdr.resId = resId; - Em_App_startIndSend(); -} - -void DUREX_messageAvailable_indicate(void) { - if (Em_App_state == Em_App_CONNECTED && Em_App_xmitReady(1 + 1)) Em_App_sendIndicator(1); -} - -#ifdef __cplusplus -} -#endif - diff --git a/DUREX/Em/DUREX.h b/DUREX/Em/DUREX.h deleted file mode 100644 index 44e6eda..0000000 --- a/DUREX/Em/DUREX.h +++ /dev/null @@ -1,68 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ - -#ifndef DUREX__H -#define DUREX__H - -#include "Em_Types.h" -#include "Em_Message.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------- connection callback functions implemented by the application -------- */ - -void DUREX_connectHandler(void); -void DUREX_disconnectHandler(void); - -/* -------- resource types defined in the schema -------- */ - -/* typedef String */ -typedef char DUREX_String[229]; -#define DUREX_String_length 229 - -/* enum BOOLEAN */ -typedef uint8_t DUREX_BOOLEAN; -#define DUREX_TRUE 0 -#define DUREX_FALSE 1 - -/* -------- resource callback functions implemented by the application -------- */ - -/* resource numBytes */ -typedef uint8_t DUREX_numBytes_t; -extern void DUREX_numBytes_fetch(DUREX_numBytes_t* output); -extern void DUREX_numBytes_store(DUREX_numBytes_t* input); - -/* resource data */ -typedef DUREX_String DUREX_data_t; -extern void DUREX_data_fetch(DUREX_data_t output); -extern void DUREX_data_store(DUREX_data_t input); - -/* resource numPackets */ -typedef uint8_t DUREX_numPackets_t; -extern void DUREX_numPackets_fetch(DUREX_numPackets_t* output); -extern void DUREX_numPackets_store(DUREX_numPackets_t* input); - -/* resource messageAvailable */ -typedef DUREX_BOOLEAN DUREX_messageAvailable_t; -extern void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* output); -extern void DUREX_messageAvailable_indicate(void); /* called by the application */ - -/* -------- application functions implemented in DUREX.c -------- */ - -void DUREX_accept(bool enable); -void DUREX_activateParameters(uint8_t group); -void DUREX_broadcastOff(void); -void DUREX_disconnect(void); -void DUREX_pairingOn(uint8_t secs, void(*handler)(void)); -void DUREX_pairingOff(void(*handler)(void)); -void DUREX_reset(void); -void DUREX_setDeviceName(const char* name); -void DUREX_start(void); - -#ifdef __cplusplus -} -#endif - -#endif /* DUREX__H */ diff --git a/DUREX/Em/Em_Message.h b/DUREX/Em/Em_Message.h deleted file mode 100644 index 3bd0d58..0000000 --- a/DUREX/Em/Em_Message.h +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef Em_Message_H_ -#define Em_Message_H_ - -#include "Em_Types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------- SRT FUNCTIONS CALLED BY HAL -------- */ - -static inline bool Em_Message_addByte(uint8_t b); -extern void Em_Message_dispatch(void); -static inline bool Em_Message_getByte(uint8_t* bp); -extern void Em_Message_restart(void); -static inline bool Em_Message_startRx(void); -static inline uint8_t Em_Message_startTx(void); - - -/* -------- HAL FUNCTIONS CALLED BY SRT -------- */ - -extern uint8_t Em_Hal_lock(void); -extern void Em_Hal_reset(void); -extern void Em_Hal_startSend(void); -extern void Em_Hal_unlock(uint8_t key); -extern void Em_Hal_watchOff(void); -extern void Em_Hal_watchOn(void); - - -/* -------- MESSAGE FORMAT -------- */ - -/* protocolLevel #4 */ -#define Em_Message_INDSIZE 4 - -typedef uint8_t Em_Message_Size; -typedef uint8_t Em_Message_Kind; -/* protocolLevel #12 -- split 16-bit resId into */ -typedef uint8_t Em_Message_ResId; -typedef uint8_t Em_Message_Chan; - -#define Em_Message_NOP 0 -#define Em_Message_FETCH 1 -#define Em_Message_FETCH_DONE 2 -#define Em_Message_STORE 3 -#define Em_Message_STORE_DONE 4 -#define Em_Message_INDICATOR 5 -#define Em_Message_CONNECT 6 -#define Em_Message_DISCONNECT 7 -#define Em_Message_ECHO 8 -/* protocolLevel #3 */ -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ -#define Em_Message_PAIRING 9 -#define Em_Message_PAIRING_DONE 10 -/* protocolLevel #7 */ -#define Em_Message_OFFLINE 11 -/* protocolLevel #8 */ -#define Em_Message_ACCEPT 12 -/* protocolLevel #13 */ -#define Em_Message_START 13 -#define Em_Message_ACTIVE_PARAMS 14 - -typedef struct Em_Message_Header { - Em_Message_Size size; - Em_Message_Kind kind; - Em_Message_ResId resId; - Em_Message_Chan chan; -} Em_Message_Header; - -typedef uint16_t Em_Message_protocolLevel_t; - -/* protocolLevel #1 */ - -/* protocolLevel #10 */ -/* #define Em_Message_SYS_SCHEMA_UUID 0xFF */ - -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL 0xFE -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL 0xFD -#define Em_Message_SYS_EAP_BUILD_DATE 0xFC - -/* protocolLevel #2 */ -#define Em_Message_SYS_FILE_INDEX_RESET 0xFB - -/* protocolLevel #5 */ -#define Em_Message_SYS_SCHEMA_HASH 0xFA - -/* protocolLevel #7 */ -#define Em_Message_SYS_RESOURCE_COUNT 0xF9 - -/* protocolLevel #9 */ -#define Em_Message_SYS_MOBILE_RSSI 0xF8 - -/* protocolLevel #11 */ -#define Em_Message_SYS_MCM_DISCONNECT 0xF7 - -/* protocolLevel #13a */ -#define Em_Message_SYS_MCM_NAME 0xF5 - - -/* -------- PRIVATE -------- */ - -extern void Em_Message_nextXmit(void); - -extern uint8_t* Em_App_inBuf; -extern uint8_t* Em_App_outBuf; -extern Em_Message_Size Em_App_xmitSize; - -extern uint8_t* _Em_Message_rxBuf; -extern uint8_t _Em_Message_rxCnt; - -extern uint8_t* _Em_Message_txBuf; -extern uint8_t _Em_Message_txCnt; - -static inline bool Em_Message_addByte(uint8_t b) { - if (_Em_Message_rxCnt == 0) { - if (b == 0) { - return false; - } - _Em_Message_rxCnt = b; - } - *_Em_Message_rxBuf++ = b; - if (--_Em_Message_rxCnt == 0) { - _Em_Message_rxBuf = 0; - if (_Em_Message_txBuf == 0) { - Em_Hal_watchOff(); - } - return true; - } - else { - return false; - } -} - -static inline bool Em_Message_getByte(uint8_t* bp) { - if (_Em_Message_txBuf == 0) { - return false; - } - if (_Em_Message_txCnt == 0) { - _Em_Message_txCnt = *_Em_Message_txBuf + 1; - } - if (--_Em_Message_txCnt > 0) { - *bp = *_Em_Message_txBuf++; - return true; - } - else { - _Em_Message_txBuf = 0; - Em_App_xmitSize = 0; - Em_Message_nextXmit(); - if (_Em_Message_rxBuf == 0) { - Em_Hal_watchOff(); - } - return false; - } -} - -static inline bool Em_Message_startRx(void) { - if (_Em_Message_rxBuf == 0) { - _Em_Message_rxBuf = Em_App_inBuf; - if (_Em_Message_txBuf == 0) { - Em_Hal_watchOn(); - } - return true; - } - else { - return false; - } -} - -static inline uint8_t Em_Message_startTx(void) { - _Em_Message_txBuf = Em_App_outBuf + 1; - _Em_Message_txCnt = 0; - if (_Em_Message_rxBuf == 0) { - Em_Hal_watchOn(); - } - return 0; -} - - -#ifdef __cplusplus -} -#endif - -#endif /*Em_Message_H_*/ diff --git a/DUREX/Em/Em_Types.h b/DUREX/Em/Em_Types.h deleted file mode 100644 index d002306..0000000 --- a/DUREX/Em/Em_Types.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef Em_Types_H_ -#define Em_Types_H_ - -#ifndef Em_NOSTDBOOL -#include -#endif - -#ifndef Em_NOSTDINT -#include -#endif - -#ifdef Em_16BIT -typedef signed char int8_t; -typedef unsigned char uint8_t; -#endif - -#endif /*Em_Types_H_*/ diff --git a/DUREX/Em/durex.json b/DUREX/Em/durex.json deleted file mode 100644 index 855e86c..0000000 --- a/DUREX/Em/durex.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "resources": { - "$eapProtocolLevel": { - "id": -3, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "numBytes": { - "id": 1, - "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", - "size": 1 - }, - "data": { - "id": 2, - "align": 1, - "attributes": {}, - "type": "C:229", - "access": "rw", - "size": 229 - }, - "$activeGroup": { - "id": -10, - "align": 1, - "pack": 1, - "attributes": {"readwrite": true}, - "type": "E:system@emmoco.com.System/ParameterGroup", - "access": "rw", - "size": 1 - }, - "$mcmDisconnect": { - "id": -9, - "align": 1, - "attributes": {"writeonly": true}, - "type": "u1", - "access": "w", - "size": 1 - }, - "$eapBuildDate": { - "dim": 8, - "id": -4, - "align": 1, - "attributes": {"readonly": true}, - "type": "A8:u1", - "access": "r", - "size": 8 - }, - "numPackets": { - "id": 3, - "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", - "size": 1 - }, - "$resourceCount": { - "id": -7, - "align": 1, - "attributes": {"readonly": true}, - "type": "S:system@emmoco.com.System/ResourceCount", - "access": "r", - "size": 2 - }, - "$schemaHash": { - "dim": 20, - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, - "messageAvailable": { - "id": 4, - "align": 1, - "pack": 1, - "attributes": {"indicator": true}, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "access": "ir", - "size": 1 - }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, - "$fileIndexReset": { - "id": -5, - "align": 2, - "attributes": {"writeonly": true}, - "type": "i2", - "access": "w", - "size": 2 - } - }, - "resourceNamesSys": [ - "$activeGroup", - "$eapBuildDate", - "$eapProtocolLevel", - "$fileIndexReset", - "$mcmDisconnect", - "$mcmProtocolLevel", - "$mobileRssi", - "$resourceCount", - "$schemaHash" - ], - "manifest": { - "protocolLevel": 13, - "hash": [ - 28, - 106, - 83, - 11, - 248, - 159, - 192, - 243, - 66, - 193, - 233, - 148, - 55, - 208, - 191, - 77 - ], - "toolVersion": "13.4.1.201311121909", - "name": "DUREX", - "$$md5": "1c6a530bf89fc0f342c1e99437d0bf4d", - "build": [ - 208, - 202, - 48, - 251, - 69, - 1, - 0, - 0 - ], - "date": "2014-05-14T16:44:10T", - "maxAlign": 2, - "maxSize": 229, - "version": "1.0.0" - }, - "resourceNames": [ - "numBytes", - "data", - "numPackets", - "messageAvailable", - "$mcmProtocolLevel", - "$eapProtocolLevel", - "$eapBuildDate", - "$fileIndexReset", - "$schemaHash", - "$resourceCount", - "$mobileRssi", - "$mcmDisconnect", - "$activeGroup" - ], - "attributes": { - "description": "", - "version": "1.0.0" - }, - "resourceNamesApp": [ - "numBytes", - "data", - "numPackets", - "messageAvailable" - ], - "types": { - "system@emmoco.com.System/ResourceCount": { - "packed": false, - "align": 1, - "type": "S:system@emmoco.com.System/ResourceCount", - "size": 2, - "fields": [ - { - "pad": 0, - "align": 1, - "name": "app", - "type": "u1", - "size": 1 - }, - { - "pad": 0, - "align": 1, - "name": "sys", - "type": "u1", - "size": 1 - } - ] - }, - "std:i2": { - "align": 2, - "size": 2 - }, - "std:i1": { - "align": 1, - "size": 1 - }, - "std:u1": { - "align": 1, - "size": 1 - }, - "@emmoco.com.DUREX/BOOLEAN": { - "values": [ - "TRUE", - "FALSE" - ], - "align": 1, - "pack": 1, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "size": 1 - }, - "system@emmoco.com.System/ParameterGroup": { - "values": [ - "GROUP_A", - "GROUP_B" - ], - "align": 1, - "pack": 1, - "type": "E:system@emmoco.com.System/ParameterGroup", - "size": 1 - }, - "std:u2": { - "align": 2, - "size": 2 - } - }, - "imports": {"@emmoco.com.DUREX": true} -} \ No newline at end of file diff --git a/DUREX/Schema-Imports/system@emmoco.com/System.ems b/DUREX/Schema-Imports/system@emmoco.com/System.ems deleted file mode 100644 index 9601635..0000000 --- a/DUREX/Schema-Imports/system@emmoco.com/System.ems +++ /dev/null @@ -1,72 +0,0 @@ -owner = "system@emmoco.com" - -schema System { - - // protocolLevel #13 - - enum ParameterGroup { - GROUP_A, GROUP_B - } - - // protocolLevel #1 - - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications - readonly - } - - uint16 $mcmProtocolLevel { - readonly - } - - uint16 $eapProtocolLevel { - readonly - } - - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber - readonly - } - - // protocolLevel #2 - - int16 $fileIndexReset { - writeonly - } - - // protocolLevel #5 - - // protocolLevel #12 -- increase size to 20 - - uint8 $schemaHash[20] { - readonly - } - - // protocolLevel #7 - - struct ResourceCount { - uint8 app - uint8 sys - } - - ResourceCount $resourceCount { - readonly - } - - // protocolLevel #9 - - int8 $mobileRssi { - readonly - } - - // protocolLevel #11 - - uint8 $mcmDisconnect { - writeonly - } - - // protocolLevel #13 - - ParameterGroup $activeGroup { - readwrite - } - -} diff --git a/DUREX/bundle.properties b/DUREX/bundle.properties deleted file mode 100644 index 07a1876..0000000 --- a/DUREX/bundle.properties +++ /dev/null @@ -1,10 +0,0 @@ -# generated file - do not edit - -bundle.requires = com.emmoco.schema.translator -com.emmoco.framework.Properties.applicationDirectory = Em -com.emmoco.framework.Properties.schemaDestinationDirectory = Em -com.emmoco.framework.Properties.serverAPIToken = -com.emmoco.framework.Properties.align16 = 2 -com.emmoco.framework.Properties.align32 = 4 -com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/durex/DUREX/schema.ems -com.emmoco.framework.Properties.toolVersion = 13.4.1.201311121909 diff --git a/DUREX/imports/system@emmoco.com/System.ems b/DUREX/imports/system@emmoco.com/System.ems deleted file mode 100644 index c71c87a..0000000 --- a/DUREX/imports/system@emmoco.com/System.ems +++ /dev/null @@ -1,60 +0,0 @@ -owner = "system@emmoco.com" - -schema System { - - // protocolLevel #1 - - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications - readonly - } - - uint16 $mcmProtocolLevel { - readonly - } - - uint16 $eapProtocolLevel { - readonly - } - - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber - readonly - } - - // protocolLevel #2 - - int16 $fileIndexReset { - writeonly - } - - // protocolLevel #5 - - // protocolLevel #12 -- increase size to 20 - - uint8 $schemaHash[20] { - readonly - } - - // protocolLevel #7 - - struct ResourceCount { - uint8 app - uint8 sys - } - - ResourceCount $resourceCount { - readonly - } - - // protocolLevel #9 - - int8 $mobileRssi { - readonly - } - - // protocolLevel #11 - - uint8 $mcmDisconnect { - writeonly - } - -} diff --git a/DUREX/out/DUREX-TODO.c b/DUREX/out/DUREX-TODO.c deleted file mode 100644 index 9089356..0000000 --- a/DUREX/out/DUREX-TODO.c +++ /dev/null @@ -1,50 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#include "DUREX.h" - -#ifdef Em_DUREX_TODO /* enables optional inclusion of empty functions */ - -/* Copy the function skeletons below into your own DUREX.c source file */ - -void DUREX_connectHandler(void) { - /* TODO: application is now connected */ -} - -void DUREX_disconnectHandler(void) { - /* TODO: application is now disconnected */ -} - -void DUREX_numBytes_fetch(DUREX_numBytes_t* const output) { - /* TODO: write resource 'numBytes' into 'output' */ -} - -void DUREX_numBytes_store(DUREX_numBytes_t* const input) { - /* TODO: read resource 'numBytes' from 'input' */ -} - -void DUREX_data_fetch(DUREX_data_t* const output) { - /* TODO: write resource 'data' into 'output' */ -} - -void DUREX_data_store(DUREX_data_t* const input) { - /* TODO: read resource 'data' from 'input' */ -} - -void DUREX_numPackets_fetch(DUREX_numPackets_t* const output) { - /* TODO: write resource 'numPackets' into 'output' */ -} - -void DUREX_numPackets_store(DUREX_numPackets_t* const input) { - /* TODO: read resource 'numPackets' from 'input' */ -} - -void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* const output) { - /* TODO: write resource 'messageAvailable' into 'output' */ -} - -void DUREX_messageAvailable_store(DUREX_messageAvailable_t* const input) { - /* TODO: read resource 'messageAvailable' from 'input' */ -} - -#endif /* dummy file */ diff --git a/DUREX/out/DUREX.c b/DUREX/out/DUREX.c deleted file mode 100644 index 59051c1..0000000 --- a/DUREX/out/DUREX.c +++ /dev/null @@ -1,355 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#include "Em_Message.h" -#include "DUREX.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define Em_Message_protocolLevel 12 - -typedef struct Em_App_Message { - uint8_t dummy; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[229]; -} Em_App_Message; - -const uint8_t Em_App_hash[] = {245, 13, 216, 92, 22, 189, 34, 32, 16, 124, 194, 50, 87, 152, 227, 110, 12, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; - -const uint8_t Em_App_build[] = {61, 15, 116, 250, 69, 1, 0, 0}; - -#define Em_App_APP_RESOURCE_COUNT 4 -#define Em_App_SYS_RESOURCE_COUNT 8 - -#define Em_App_ACCEPT DUREX_accept -#define Em_App_DISCONNECT DUREX_disconnect -#define Em_App_PAIRINGON DUREX_pairingOn -#define Em_App_PAIRINGOFF DUREX_pairingOff -#define Em_App_RESET DUREX_reset -#define Em_App_RUN DUREX_run - -#define Em_App_CONNECTHANDLER DUREX_connectHandler -#define Em_App_DISCONNECTHANDLER DUREX_disconnectHandler - -#define Em_App_MAX_INDICATOR 2 - -enum {Em_App_IDLE, Em_App_DISCONNECTED, Em_App_CONNECTED}; - -typedef struct Em_App_Indicator { - uint8_t dummy; - uint8_t sot; - Em_Message_Header hdr; - uint8_t data[Em_Message_INDSIZE]; -} Em_App_Indicator; - -void (*Em_App_pdHdlr)(void); - -const uint16_t Em_App_endian = 0x0100; - -Em_Message_Size Em_App_recvIdx; -Em_Message_Size Em_App_recvSize; -Em_Message_Size Em_App_xmitIdx; -Em_Message_Size Em_App_xmitSize; - -uint8_t Em_App_state = Em_App_IDLE; -Em_App_Message Em_App_msg; -Em_App_Indicator Em_App_ind; -bool Em_App_moreData = false; -bool Em_App_readIdle = true; -int32_t Em_App_fileIndex; -uint32_t Em_App_xmitMask; - -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; -uint8_t* Em_App_outBuf; - -void Em_App_fetchDispatch(void); -void Em_App_storeDispatch(void); -void Em_App_sendIndicator(Em_Message_ResId indId); -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); -void Em_App_startIndSend(void); -void Em_App_startResSend(void); -void Em_App_sysFetchDispatch(void); -void Em_App_sysStoreDispatch(void); -bool Em_App_xmitReady(Em_Message_ResId indId); - -bool Em_Message_addByte(uint8_t b) { - if (Em_App_readIdle && b) { - Em_App_recvSize = Em_App_inBuf[0] = b; - Em_App_recvIdx = 1; - Em_App_readIdle = false; - return false; - } - Em_App_inBuf[Em_App_recvIdx++] = b; - if (Em_App_recvIdx < Em_App_recvSize) { - return false; - } - Em_App_readIdle = true; - return true; -} - -bool Em_Message_getByte(uint8_t* bp) { - uint8_t key = Em_Message_lock(); - Em_App_moreData = (Em_App_xmitSize != 0); - if (!Em_App_moreData && (Em_App_xmitMask != 0)) { - uint8_t i; - uint32_t m; - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { - if (Em_App_xmitMask & m) { - Em_App_xmitMask &= ~m; - if (i == 0) { - Em_App_startResSend(); - } - else { - Em_App_sendIndicator(i); - } - break; - } - } - Em_Message_unlock(key); - return false; - } - else if (Em_App_moreData) { - *bp = Em_App_outBuf[Em_App_xmitIdx++]; - Em_App_xmitSize -= 1; - } - Em_Message_unlock(key); - return Em_App_moreData; -} - -void Em_App_ACCEPT(bool enable) { - if (Em_App_state == Em_App_CONNECTED) { - return; - } - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_ACCEPT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = enable; - Em_App_startIndSend(); -} - -void Em_App_DISCONNECT(void) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_state = Em_App_DISCONNECTED; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = 0; - Em_App_startIndSend(); -} - -void Em_Message_dispatch(void) { - if (Em_App_state == Em_App_IDLE) { - return; - } - switch (Em_App_msg.hdr.kind) { - case Em_Message_CONNECT: - Em_App_state = Em_App_CONNECTED; - Em_App_CONNECTHANDLER(); - break; - case Em_Message_DISCONNECT: - Em_App_state = Em_App_DISCONNECTED; - Em_App_DISCONNECTHANDLER(); - break; - case Em_Message_PAIRING_DONE: - if (Em_App_pdHdlr) { - (*Em_App_pdHdlr)(); - } - break; - case Em_Message_FETCH: - if (Em_App_msg.hdr.resId > 0) { - Em_App_fetchDispatch(); - } - else { - Em_App_sysFetchDispatch(); - } - break; - case Em_Message_STORE: - if (Em_App_msg.hdr.resId > 0) { - Em_App_storeDispatch(); - } - else { - Em_App_sysStoreDispatch(); - } - break; - } -} - -void Em_App_PAIRINGOFF(void(*handler)(void)) { - Em_App_PAIRINGON(0, handler); -} - -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { - if (Em_App_state != Em_App_DISCONNECTED) { - return; - } - Em_App_pdHdlr = handler; - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_PAIRING; - Em_App_ind.hdr.size = sizeof (Em_Message_Header); - Em_App_ind.hdr.resId = secs; - Em_App_startIndSend(); -} - -void Em_App_RESET(void) { - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; - Em_App_state = Em_App_IDLE; - Em_App_moreData = false; - Em_App_readIdle = true; - Em_App_fileIndex = 0; - Em_App_xmitMask = 0; -} - -void Em_App_RUN(void) { - Em_App_state = Em_App_DISCONNECTED; -} - -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { - if (Em_App_state != Em_App_CONNECTED) { - return; - } - Em_App_msg.sot = 0; - Em_App_msg.hdr.kind = kind; - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); - if (Em_App_xmitReady(0)) { - Em_App_startResSend(); - } -} - -void Em_App_startIndSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; - Em_App_xmitSize = Em_App_ind.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Message_startSend(); -} - -void Em_App_startResSend(void) { - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; - Em_App_xmitSize = Em_App_msg.hdr.size + 1; - Em_App_xmitIdx = 0; - Em_Message_startSend(); -} - -void Em_App_sysFetchDispatch(void) { - uint8_t size = 0; - int i; - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_SCHEMA_HASH: - for (i = 0; i < sizeof (Em_App_hash); i++) { - Em_App_msg.data[i] = Em_App_hash[i]; - } - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); - size = sizeof (Em_App_hash) + 1; - break; - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; - size = sizeof (Em_Message_protocolLevel_t); - break; - case Em_Message_SYS_EAP_BUILD_DATE: - for (i = 0; i < sizeof (Em_App_build); i++) { - Em_App_msg.data[i] = Em_App_build[i]; - } - size = sizeof (Em_App_build); - break; - case Em_Message_SYS_RESOURCE_COUNT: - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; - size = 2; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_sysStoreDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case Em_Message_SYS_FILE_INDEX_RESET: - Em_App_fileIndex = 0; - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -bool Em_App_xmitReady(Em_Message_ResId indId) { - uint8_t key = Em_Message_lock(); - bool res = !Em_App_moreData && Em_App_xmitMask == 0; - if (!res) { - Em_App_xmitMask |= (1 << indId); - } - Em_Message_unlock(key); - return res; -} - -void Em_App_fetchDispatch(void) { - uint8_t size = 0; - switch (Em_App_msg.hdr.resId) { - case 0: - break; - case 1: - DUREX_numBytes_fetch((DUREX_numBytes_t*)Em_App_msg.data); - size = 1; - break; - case 2: - DUREX_data_fetch((DUREX_data_t*)Em_App_msg.data); - size = 229; - break; - case 3: - DUREX_numPackets_fetch((DUREX_numPackets_t*)Em_App_msg.data); - size = 1; - break; - case 4: - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)Em_App_msg.data); - size = 1; - break; - } - Em_App_sendResponse(Em_Message_FETCH_DONE, size); -} - -void Em_App_storeDispatch(void) { - switch (Em_App_msg.hdr.resId) { - case 0: - break; - case 1: - DUREX_numBytes_store((DUREX_numBytes_t*)Em_App_msg.data); - break; - case 2: - DUREX_data_store((DUREX_data_t*)Em_App_msg.data); - break; - case 3: - DUREX_numPackets_store((DUREX_numPackets_t*)Em_App_msg.data); - break; - case 4: - DUREX_messageAvailable_store((DUREX_messageAvailable_t*)Em_App_msg.data); - break; - } - Em_App_sendResponse(Em_Message_STORE_DONE, 0); -} - -void Em_App_sendIndicator(Em_Message_ResId indId) { - Em_Message_Size resId = 0; - Em_Message_Size size = 0; - switch (indId) { - case 1: - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)&Em_App_ind.data); - resId = 4; - size = 1; - break; -} - Em_App_ind.sot = 0; - Em_App_ind.hdr.kind = Em_Message_INDICATOR; - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; - Em_App_ind.hdr.resId = resId; - Em_App_startIndSend(); -} - -void DUREX_messageAvailable_indicate(void) { - if (Em_App_state != Em_App_IDLE && Em_App_xmitReady(1)) Em_App_sendIndicator(1); -} - -#ifdef __cplusplus -} -#endif - diff --git a/DUREX/out/DUREX.h b/DUREX/out/DUREX.h deleted file mode 100644 index b66f607..0000000 --- a/DUREX/out/DUREX.h +++ /dev/null @@ -1,59 +0,0 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ - -#ifndef DUREX__H -#define DUREX__H - -#include "Em_Types.h" -#include "Em_Message.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* typedef String */ -typedef char DUREX_String; -#define DUREX_String_length 229 - -/* enum BOOLEAN */ -typedef uint8_t DUREX_BOOLEAN; -#define DUREX_TRUE 0 -#define DUREX_FALSE 1 - -/* resource numBytes */ -typedef uint8_t DUREX_numBytes_t; -extern void DUREX_numBytes_fetch(DUREX_numBytes_t* const output); -extern void DUREX_numBytes_store(DUREX_numBytes_t* const input); - -/* resource data */ -typedef DUREX_String DUREX_data_t[229]; -extern void DUREX_data_fetch(DUREX_data_t* const output); -extern void DUREX_data_store(DUREX_data_t* const input); - -/* resource numPackets */ -typedef uint8_t DUREX_numPackets_t; -extern void DUREX_numPackets_fetch(DUREX_numPackets_t* const output); -extern void DUREX_numPackets_store(DUREX_numPackets_t* const input); - -/* resource messageAvailable */ -typedef DUREX_BOOLEAN DUREX_messageAvailable_t; -extern void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* const output); -extern void DUREX_messageAvailable_store(DUREX_messageAvailable_t* const input); -extern void DUREX_messageAvailable_indicate(void); - -void DUREX_reset(void); -void DUREX_run(void); - -void DUREX_accept(bool enable); -void DUREX_disconnect(void); -void DUREX_pairingOn(uint8_t secs, void(*handler)(void)); -void DUREX_pairingOff(void(*handler)(void)); - -void DUREX_connectHandler(void); -void DUREX_disconnectHandler(void); - -#ifdef __cplusplus -} -#endif - -#endif /* DUREX__H */ diff --git a/DUREX/out/DUREX.zip b/DUREX/out/DUREX.zip deleted file mode 100644 index ce6a25a..0000000 --- a/DUREX/out/DUREX.zip +++ /dev/null diff --git a/DUREX/out/Em_Message.h b/DUREX/out/Em_Message.h deleted file mode 100644 index dd64233..0000000 --- a/DUREX/out/Em_Message.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef Em_Message_H_ -#define Em_Message_H_ - -#include "Em_Types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* protocolLevel #4 */ -#define Em_Message_INDSIZE 4 - -typedef uint8_t Em_Message_Size; -typedef uint8_t Em_Message_Kind; -/* protocolLevel #12 -- split 16-bit resId into */ -typedef int8_t Em_Message_ResId; -typedef uint8_t Em_Message_Chan; - -#define Em_Message_NOP 0 -#define Em_Message_FETCH 1 -#define Em_Message_FETCH_DONE 2 -#define Em_Message_STORE 3 -#define Em_Message_STORE_DONE 4 -#define Em_Message_INDICATOR 5 -#define Em_Message_CONNECT 6 -#define Em_Message_DISCONNECT 7 -#define Em_Message_ECHO 8 -/* protocolLevel #3 */ -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ -#define Em_Message_PAIRING 9 -#define Em_Message_PAIRING_DONE 10 -/* protocolLevel #7 */ -#define Em_Message_OFFLINE 11 -/* protocolLevel #8 */ -#define Em_Message_ACCEPT 12 - -typedef struct Em_Message_Header { - Em_Message_Size size; - Em_Message_Kind kind; - Em_Message_ResId resId; - Em_Message_Chan chan; -} Em_Message_Header; - -typedef uint16_t Em_Message_protocolLevel_t; - -/* protocolLevel #1 */ - -/* protocolLevel #10 */ -/* #define Em_Message_SYS_SCHEMA_UUID -1 */ - -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL -2 -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL -3 -#define Em_Message_SYS_EAP_BUILD_DATE -4 - -/* protocolLevel #2 */ -#define Em_Message_SYS_FILE_INDEX_RESET -5 - -/* protocolLevel #5 */ -#define Em_Message_SYS_SCHEMA_HASH -6 - -/* protocolLevel #7 */ -#define Em_Message_SYS_RESOURCE_COUNT -7 - -/* protocolLevel #9 */ -#define Em_Message_SYS_MOBILE_RSSI -8 - -/* protocolLevel #11 */ -#define Em_Message_SYS_MCM_DISCONNECT -9 - -extern void Em_Message_init(void); - -extern bool Em_Message_addByte(uint8_t b); -extern void Em_Message_dispatch(void); -extern bool Em_Message_getByte(uint8_t *bp); -extern uint8_t Em_Message_lock(void); -extern void Em_Message_startSend(void); -extern void Em_Message_unlock(uint8_t key); - -#ifdef __cplusplus -} -#endif - -#endif /*Em_Message_H_*/ diff --git a/DUREX/out/Em_Types.h b/DUREX/out/Em_Types.h deleted file mode 100644 index a221d54..0000000 --- a/DUREX/out/Em_Types.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Em_Types_H_ -#define Em_Types_H_ - -#ifndef EM_NOSTDBOOL -#include -#endif - -#ifndef EM_NOSTDINT -#include -#endif - -#endif /*Em_Types_H_*/ diff --git a/DUREX/out/durex.json b/DUREX/out/durex.json deleted file mode 100644 index 5bd3423..0000000 --- a/DUREX/out/durex.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "resources": { - "$schemaHash": { - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, - "$eapProtocolLevel": { - "id": -3, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "messageAvailable": { - "id": 4, - "align": 1, - "attributes": {"indicator": true}, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "access": "irw", - "size": 1 - }, - "numBytes": { - "id": 1, - "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", - "size": 1 - }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, - "data": { - "id": 2, - "align": 1, - "attributes": {}, - "type": "C:229", - "access": "rw", - "size": 229 - }, - "$mcmDisconnect": { - "id": -9, - "align": 1, - "attributes": {"writeonly": true}, - "type": "u1", - "access": "w", - "size": 1 - }, - "$eapBuildDate": { - "id": -4, - "align": 1, - "attributes": {"readonly": true}, - "type": "A8:u1", - "access": "r", - "size": 8 - }, - "$resourceCount": { - "id": -7, - "align": 1, - "attributes": {"readonly": true}, - "type": "S:system@emmoco.com.System/ResourceCount", - "access": "r", - "size": 2 - }, - "numPackets": { - "id": 3, - "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", - "size": 1 - }, - "$fileIndexReset": { - "id": -5, - "align": 2, - "attributes": {"writeonly": true}, - "type": "i2", - "access": "w", - "size": 2 - } - }, - "resourceNamesSys": [ - "$eapBuildDate", - "$eapProtocolLevel", - "$fileIndexReset", - "$mcmDisconnect", - "$mcmProtocolLevel", - "$mobileRssi", - "$resourceCount", - "$schemaHash" - ], - "manifest": { - "protocolLevel": 12, - "hash": [ - 245, - 13, - 216, - 92, - 22, - 189, - 34, - 32, - 16, - 124, - 194, - 50, - 87, - 152, - 227, - 110 - ], - "toolVersion": "12.0.0.201211010336", - "name": "DUREX", - "$$md5": "f316f8e8839db2a2939bf3e0120a1fdf", - "build": [ - 61, - 15, - 116, - 250, - 69, - 1, - 0, - 0 - ], - "date": "2014-05-14T13:18:01T", - "maxAlign": 2, - "maxSize": 229, - "version": "1.0.0" - }, - "resourceNames": [ - "numBytes", - "data", - "numPackets", - "messageAvailable", - "$mcmProtocolLevel", - "$eapProtocolLevel", - "$eapBuildDate", - "$fileIndexReset", - "$schemaHash", - "$resourceCount", - "$mobileRssi", - "$mcmDisconnect" - ], - "attributes": { - "description": "", - "version": "1.0.0" - }, - "types": { - "system@emmoco.com.System/ResourceCount": { - "align": 1, - "type": "S:system@emmoco.com.System/ResourceCount", - "size": 2, - "fields": [ - { - "pad": 0, - "align": 1, - "name": "app", - "type": "u1", - "size": 1 - }, - { - "pad": 0, - "align": 1, - "name": "sys", - "type": "u1", - "size": 1 - } - ] - }, - "std:i2": { - "align": 2, - "size": 2 - }, - "std:i1": { - "align": 1, - "size": 1 - }, - "@emmoco.com.DUREX/BOOLEAN": { - "values": [ - "TRUE", - "FALSE" - ], - "align": 1, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "size": 1 - }, - "std:u1": { - "align": 1, - "size": 1 - }, - "std:u2": { - "align": 2, - "size": 2 - } - }, - "resourceNamesApp": [ - "data", - "messageAvailable", - "numBytes", - "numPackets" - ], - "imports": {"@emmoco.com.DUREX": true} -} \ No newline at end of file diff --git a/DUREX/schema.ems b/DUREX/schema.ems deleted file mode 100644 index 04b2df6..0000000 --- a/DUREX/schema.ems +++ /dev/null @@ -1,16 +0,0 @@ -version = "1.0.0" -description = "" - -schema DUREX -{ - enum BOOLEAN{ TRUE, FALSE }; - typedef string<228> String; //MAXIMUM SIZE AVAILABLE - - uint8 numBytes; - String data; - uint8 numPackets; - BOOLEAN messageAvailable - { - indicator - } -} diff --git a/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Builder.launch b/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Builder.launch deleted file mode 100644 index 5d24391..0000000 --- a/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Builder.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Cleaner.launch b/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Cleaner.launch deleted file mode 100644 index 0a85be5..0000000 --- a/DUREXLaunchpad/.externalToolBuilders/DUREX LaunchPad Cleaner.launch +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/DUREXLaunchpad/.gitignore b/DUREXLaunchpad/.gitignore deleted file mode 100644 index ea47c16..0000000 --- a/DUREXLaunchpad/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/main.map -/main.out diff --git a/DUREXLaunchpad/.project b/DUREXLaunchpad/.project deleted file mode 100644 index 8c71a62..0000000 --- a/DUREXLaunchpad/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - DUREXLaunchpad - - - DUREX - - - - org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, - - - LaunchConfigHandle - <project>/.externalToolBuilders/DUREX LaunchPad Builder.launch - - - - - org.eclipse.ui.externaltools.ExternalToolBuilder - clean, - - - LaunchConfigHandle - <project>/.externalToolBuilders/DUREX LaunchPad Cleaner.launch - - - - - - com.emmoco.mcmtooling.example.mcmToolingExampleNature - - diff --git a/DUREXLaunchpad/.settings/org.eclipse.ltk.core.refactoring.prefs b/DUREXLaunchpad/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index b196c64..0000000 --- a/DUREXLaunchpad/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/DUREXLaunchpad/DUREX.obj b/DUREXLaunchpad/DUREX.obj deleted file mode 100644 index 7415729..0000000 --- a/DUREXLaunchpad/DUREX.obj +++ /dev/null diff --git a/DUREXLaunchpad/Log/log.txt b/DUREXLaunchpad/Log/log.txt deleted file mode 100644 index e69de29..0000000 --- a/DUREXLaunchpad/Log/log.txt +++ /dev/null diff --git a/DUREXLaunchpad/main.c b/DUREXLaunchpad/main.c deleted file mode 100644 index b5a8834..0000000 --- a/DUREXLaunchpad/main.c +++ /dev/null @@ -1,270 +0,0 @@ -/* - * ============ Platform Configuration ============ - */ - -#include - -#define EAP_RX_BUF UCA0RXBUF -#define EAP_TX_BUF UCA0TXBUF - -#define EAP_RX_VECTOR USCIAB0RX_VECTOR -#define EAP_TX_VECTOR PORT2_VECTOR - -#define EAP_RX_ACK_CONFIG() (P2DIR |= BIT0) -#define EAP_RX_ACK_SET() (P2OUT |= BIT0) -#define EAP_RX_ACK_CLR() (P2OUT &= ~BIT0) - -#define EAP_TX_INT_CONFIG() (P2DIR &= ~BIT1, P2IES |= BIT1, P2IFG &= BIT1, P2IE |= BIT1) -#define EAP_TX_INT_TST() (P2IFG & BIT1) -#define EAP_TX_INT_CLR() (P2IFG &= ~BIT1) - -void init(void) -{ - WDTCTL = WDTPW + WDTHOLD; - BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0; - if (CALBC1_1MHZ != 0xFF) - { - DCOCTL = 0x00; - BCSCTL1 = CALBC1_1MHZ; /* Set DCO to 1MHz */ - DCOCTL = CALDCO_1MHZ; - } - BCSCTL1 |= XT2OFF + DIVA_0; - BCSCTL3 = XT2S_0 + LFXT1S_2 + XCAP_1; - - P1DIR |= BIT0 + BIT6; /* LED */ - P1OUT &= ~BIT0; - - UCA0CTL1 |= UCSWRST; - - P1SEL |= BIT1 + BIT2; - P1SEL2 |= BIT1 + BIT2; - - EAP_RX_ACK_CONFIG(); - EAP_RX_ACK_SET(); - - EAP_TX_INT_CONFIG(); - - UCA0CTL1 = UCSSEL_2 + UCSWRST; - UCA0MCTL = UCBRF_0 + UCBRS_6; - UCA0BR0 = 8; - UCA0CTL1 &= ~UCSWRST; - - IFG2 &= ~(UCA0RXIFG); - IE2 |= UCA0RXIE; - - __enable_interrupt(); -} - -/* - * ============ Serial Driver ============ - */ - -#include - -__attribute__((interrupt(EAP_RX_VECTOR))) -static void rxHandler(void) -{ - uint8_t b = EAP_RX_BUF; - if (Em_Message_addByte(b)) - { - Em_Message_dispatch(); - } - EAP_RX_ACK_CLR(); - EAP_RX_ACK_SET(); -} - -__attribute__((interrupt(EAP_TX_VECTOR))) -static void txHandler(void) -{ - if (EAP_TX_INT_TST()) - { - uint8_t b; - if (Em_Message_getByte(&b)) - { - EAP_TX_BUF = b; - } - EAP_TX_INT_CLR(); - } -} - -void Em_Message_startSend() -{ - uint8_t b; - if (Em_Message_getByte(&b)) - { - UCA0TXBUF = b; - } -} - -uint8_t Em_Message_lock() -{ - uint8_t key; - asm ("MOV r2, %0": "=r" (key)); - key &= 0x8; - asm ("DINT"); - return key; -} - -void Em_Message_unlock(uint8_t key) -{ - if (key) - { - asm ("EINT"); - } - else - { - asm ("DINT"); - } -} - -/* - * Extra code and interrupts - */ - -void led0_toggle(void) -{ - P1OUT ^= BIT0; -} - -void led1_toggle(void) -{ - P1OUT ^= BIT6; -} - -void led0_on(void) -{ - P1OUT |= BIT0; -} - -void led0_off(void) -{ - P1OUT &= ~BIT0; -} - -void led1_on(void) -{ - P1OUT |= BIT6; -} - -void led1_off(void) -{ - P1OUT &= ~BIT6; -} - -__attribute__((interrupt(TIMER0_A0_VECTOR))) -static void Timer_A (void) -{ - led0_toggle(); // Toggle LED - //led1_toggle(); -} - -void initTimer(void) -{ - CCTL0 = CCIE; // CCR0 interrupt enabled - CCR0 = 2048; // 32kHz/8/4096 -> 1 sec - TACTL = TASSEL_1 + ID_3 + MC_1; // ACLK, /8, upmode - led1_off(); -} - -void stopTimer(void) -{ - CCTL0 ^= CCTL0 ; -} - -/* - * ============ Application Program ============ - */ - -#include -#include - -DUREX_numBytes_t numBytes = 0; -DUREX_data_t data = ""; -DUREX_numPackets_t numPackets = 0; -DUREX_messageAvailable_t messageAvailable = 0; -uint8_t lastMessageAck = 1; - -int main(int argc, char *argv[]) -{ - volatile int dummy = 0; - init(); - initTimer(); - DUREX_run(); - while (dummy == 0) - { - /* idle */ - } - return 0; -} - -void DUREX_connectHandler(void) -{ - stopTimer(); - led0_on(); - led1_off(); -} - -void DUREX_disconnectHandler(void) -{ - led0_off(); - led1_off(); - initTimer(); -} - -void DUREX_numBytes_fetch(DUREX_numBytes_t* const output) -{ - *output = numBytes; -} - -void DUREX_numBytes_store(DUREX_numBytes_t* const input) -{ - numBytes = *input; -} - -void DUREX_data_fetch(DUREX_data_t* const output) -{ - memcpy(output,data,numBytes); -} - -void DUREX_data_store(DUREX_data_t* const input) -{ - memcpy(data,input,numBytes); -} - -void DUREX_numPackets_fetch(DUREX_numPackets_t* const output) -{ - *output = numPackets; -} - -void DUREX_numPackets_store(DUREX_numPackets_t* const input) -{ - numPackets = *input; -} - -void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* const output) -{ - *output = messageAvailable; -} - -void DUREX_messageAvailable_store(DUREX_messageAvailable_t* const input) -{ - messageAvailable = *input; - if(messageAvailable == DUREX_TRUE) - { - led1_on(); - lastMessageAck = 0; - messageAvailable = DUREX_FALSE; - DUREX_messageAvailable_indicate(); - memcpy(data,"ACK",4); - numPackets = 1; - numBytes = 4; - messageAvailable = DUREX_TRUE; - DUREX_messageAvailable_indicate(); - } - else if(messageAvailable == DUREX_FALSE) - { - led1_off(); - lastMessageAck = 1; - } -} - diff --git a/DUREXLaunchpad/main.map b/DUREXLaunchpad/main.map deleted file mode 100644 index 3bd348b..0000000 --- a/DUREXLaunchpad/main.map +++ /dev/null @@ -1,620 +0,0 @@ -Archive member included because of file (symbol) - -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - main.obj (memcpy) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_reset_vector__) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__watchdog_support) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__init_stack) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__low_level_init) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_copy_data) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_clear_bss) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__stop_progExec__) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (_endless_loop__) -/Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_unexpected_) - -Allocating common symbols -Common symbol size file - -Em_App_recvIdx 0x1 DUREX.obj -Em_App_xmitSize 0x1 DUREX.obj -Em_App_outBuf 0x2 DUREX.obj -Em_App_ind 0xa DUREX.obj -Em_App_xmitMask 0x4 DUREX.obj -Em_App_msg 0xec DUREX.obj -Em_App_recvSize 0x1 DUREX.obj -Em_App_fileIndex 0x4 DUREX.obj -Em_App_pdHdlr 0x2 DUREX.obj -Em_App_xmitIdx 0x1 DUREX.obj - -Memory Configuration - -Name Origin Length Attributes -sfr 0x0000000000000000 0x0000000000000010 -peripheral_8bit 0x0000000000000010 0x00000000000000f0 -peripheral_16bit 0x0000000000000100 0x0000000000000100 -ram 0x0000000000000200 0x0000000000000200 xw -infomem 0x0000000000001000 0x0000000000000100 -infod 0x0000000000001000 0x0000000000000040 -infoc 0x0000000000001040 0x0000000000000040 -infob 0x0000000000001080 0x0000000000000040 -infoa 0x00000000000010c0 0x0000000000000040 -rom 0x000000000000c000 0x0000000000003fe0 xr -vectors 0x000000000000ffe0 0x0000000000000020 -bsl 0x0000000000000000 0x0000000000000000 -far_rom 0x0000000000000000 0x0000000000000000 -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - -LOAD /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o -LOAD main.obj -LOAD DUREX.obj -LOAD /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a -LOAD /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a -LOAD /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a -LOAD /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a - 0x0000000000000040 PROVIDE (__info_segment_size, 0x40) - 0x0000000000001000 PROVIDE (__infod, 0x1000) - 0x0000000000001040 PROVIDE (__infoc, 0x1040) - 0x0000000000001080 PROVIDE (__infob, 0x1080) - 0x00000000000010c0 PROVIDE (__infoa, 0x10c0) - 0x0000000000000000 __IE1 = 0x0 - 0x0000000000000002 __IFG1 = 0x2 - 0x0000000000000001 __IE2 = 0x1 - 0x0000000000000003 __IFG2 = 0x3 - 0x0000000000000048 __ADC10DTC0 = 0x48 - 0x0000000000000049 __ADC10DTC1 = 0x49 - 0x000000000000004a __ADC10AE0 = 0x4a - 0x00000000000001b0 __ADC10CTL0 = 0x1b0 - 0x00000000000001b2 __ADC10CTL1 = 0x1b2 - 0x00000000000001b4 __ADC10MEM = 0x1b4 - 0x00000000000001bc __ADC10SA = 0x1bc - 0x0000000000000056 __DCOCTL = 0x56 - 0x0000000000000057 __BCSCTL1 = 0x57 - 0x0000000000000058 __BCSCTL2 = 0x58 - 0x0000000000000053 __BCSCTL3 = 0x53 - 0x0000000000000059 __CACTL1 = 0x59 - 0x000000000000005a __CACTL2 = 0x5a - 0x000000000000005b __CAPD = 0x5b - 0x0000000000000128 __FCTL1 = 0x128 - 0x000000000000012a __FCTL2 = 0x12a - 0x000000000000012c __FCTL3 = 0x12c - 0x0000000000000020 __P1IN = 0x20 - 0x0000000000000021 __P1OUT = 0x21 - 0x0000000000000022 __P1DIR = 0x22 - 0x0000000000000023 __P1IFG = 0x23 - 0x0000000000000024 __P1IES = 0x24 - 0x0000000000000025 __P1IE = 0x25 - 0x0000000000000026 __P1SEL = 0x26 - 0x0000000000000041 __P1SEL2 = 0x41 - 0x0000000000000027 __P1REN = 0x27 - 0x0000000000000028 __P2IN = 0x28 - 0x0000000000000029 __P2OUT = 0x29 - 0x000000000000002a __P2DIR = 0x2a - 0x000000000000002b __P2IFG = 0x2b - 0x000000000000002c __P2IES = 0x2c - 0x000000000000002d __P2IE = 0x2d - 0x000000000000002e __P2SEL = 0x2e - 0x0000000000000042 __P2SEL2 = 0x42 - 0x000000000000002f __P2REN = 0x2f - 0x0000000000000018 __P3IN = 0x18 - 0x0000000000000019 __P3OUT = 0x19 - 0x000000000000001a __P3DIR = 0x1a - 0x000000000000001b __P3SEL = 0x1b - 0x0000000000000043 __P3SEL2 = 0x43 - 0x0000000000000010 __P3REN = 0x10 - 0x000000000000012e __TA0IV = 0x12e - 0x0000000000000160 __TA0CTL = 0x160 - 0x0000000000000162 __TA0CCTL0 = 0x162 - 0x0000000000000164 __TA0CCTL1 = 0x164 - 0x0000000000000166 __TA0CCTL2 = 0x166 - 0x0000000000000170 __TA0R = 0x170 - 0x0000000000000172 __TA0CCR0 = 0x172 - 0x0000000000000174 __TA0CCR1 = 0x174 - 0x0000000000000176 __TA0CCR2 = 0x176 - 0x000000000000011e __TA1IV = 0x11e - 0x0000000000000180 __TA1CTL = 0x180 - 0x0000000000000182 __TA1CCTL0 = 0x182 - 0x0000000000000184 __TA1CCTL1 = 0x184 - 0x0000000000000186 __TA1CCTL2 = 0x186 - 0x0000000000000190 __TA1R = 0x190 - 0x0000000000000192 __TA1CCR0 = 0x192 - 0x0000000000000194 __TA1CCR1 = 0x194 - 0x0000000000000196 __TA1CCR2 = 0x196 - 0x0000000000000060 __UCA0CTL0 = 0x60 - 0x0000000000000061 __UCA0CTL1 = 0x61 - 0x0000000000000062 __UCA0BR0 = 0x62 - 0x0000000000000063 __UCA0BR1 = 0x63 - 0x0000000000000064 __UCA0MCTL = 0x64 - 0x0000000000000065 __UCA0STAT = 0x65 - 0x0000000000000066 __UCA0RXBUF = 0x66 - 0x0000000000000067 __UCA0TXBUF = 0x67 - 0x000000000000005d __UCA0ABCTL = 0x5d - 0x000000000000005e __UCA0IRTCTL = 0x5e - 0x000000000000005f __UCA0IRRCTL = 0x5f - 0x0000000000000068 __UCB0CTL0 = 0x68 - 0x0000000000000069 __UCB0CTL1 = 0x69 - 0x000000000000006a __UCB0BR0 = 0x6a - 0x000000000000006b __UCB0BR1 = 0x6b - 0x000000000000006c __UCB0I2CIE = 0x6c - 0x000000000000006d __UCB0STAT = 0x6d - 0x000000000000006e __UCB0RXBUF = 0x6e - 0x000000000000006f __UCB0TXBUF = 0x6f - 0x0000000000000118 __UCB0I2COA = 0x118 - 0x000000000000011a __UCB0I2CSA = 0x11a - 0x0000000000000120 __WDTCTL = 0x120 - 0x00000000000010f8 __CALDCO_16MHZ = 0x10f8 - 0x00000000000010f9 __CALBC1_16MHZ = 0x10f9 - 0x00000000000010fa __CALDCO_12MHZ = 0x10fa - 0x00000000000010fb __CALBC1_12MHZ = 0x10fb - 0x00000000000010fc __CALDCO_8MHZ = 0x10fc - 0x00000000000010fd __CALBC1_8MHZ = 0x10fd - 0x00000000000010fe __CALDCO_1MHZ = 0x10fe - 0x00000000000010ff __CALBC1_1MHZ = 0x10ff - -.hash - *(.hash) - -.dynsym - *(.dynsym) - -.dynstr - *(.dynstr) - -.gnu.version - *(.gnu.version) - -.gnu.version_d - *(.gnu.version_d) - -.gnu.version_r - *(.gnu.version_r) - -.rel.init - *(.rel.init) - -.rela.init - *(.rela.init) - -.rel.fini - *(.rel.fini) - -.rela.fini - *(.rela.fini) - -.rel.text - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) - -.rela.text - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - -.rel.rodata - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) - -.rela.rodata - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - -.rel.data - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) - -.rela.data - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - -.rel.bss - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) - -.rela.bss - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - -.rel.ctors - *(.rel.ctors) - -.rela.ctors - *(.rela.ctors) - -.rel.dtors - *(.rel.dtors) - -.rela.dtors - *(.rela.dtors) - -.rel.got - *(.rel.got) - -.rela.got - *(.rela.got) - -.rel.plt - *(.rel.plt) - -.rela.plt - *(.rela.plt) - -.text 0x000000000000c000 0x7aa - 0x000000000000c000 . = ALIGN (0x2) - *(.init .init.*) - *(.init0) - .init0 0x000000000000c000 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - 0x000000000000c000 _reset_vector__ - *(.init1) - .init1 0x000000000000c000 0xc /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - 0x000000000000c000 __watchdog_support - *(.init2) - .init2 0x000000000000c00c 0x4 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - 0x000000000000c00c __init_stack - *(.init3) - .init3 0x000000000000c010 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - 0x000000000000c010 __low_level_init - *(.init4) - .init4 0x000000000000c010 0x18 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - 0x000000000000c010 __do_copy_data - .init4 0x000000000000c028 0x16 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - 0x000000000000c028 __do_clear_bss - *(.init5) - *(.init6) - *(.init7) - *(.init8) - *(.init9) - .init9 0x000000000000c03e 0x1c main.obj - 0x000000000000c03e main - *(.fini9) - .fini9 0x000000000000c05a 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - 0x000000000000c05a __stop_progExec__ - *(.fini8) - *(.fini7) - *(.fini6) - *(.fini5) - *(.fini4) - *(.fini3) - *(.fini2) - *(.fini1) - *(.fini0) - .fini0 0x000000000000c05a 0x6 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - 0x000000000000c05a _endless_loop__ - *(.fini .fini.*) - 0x000000000000c060 . = ALIGN (0x2) - 0x000000000000c060 __ctors_start = . - *(.ctors) - 0x000000000000c060 __ctors_end = . - 0x000000000000c060 __dtors_start = . - *(.dtors) - 0x000000000000c060 __dtors_end = . - 0x000000000000c060 . = ALIGN (0x2) - *(.text .text.* .gnu.linkonce.t.*) - .text 0x000000000000c060 0x4 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - 0x000000000000c060 __isr_1 - 0x000000000000c060 __isr_4 - 0x000000000000c060 __isr_11 - 0x000000000000c060 __isr_5 - 0x000000000000c060 __isr_2 - 0x000000000000c060 __isr_10 - 0x000000000000c060 __isr_0 - 0x000000000000c060 __isr_8 - 0x000000000000c060 __isr_12 - 0x000000000000c060 __isr_13 - 0x000000000000c060 __isr_6 - 0x000000000000c060 __isr_14 - .text.crt0 0x000000000000c064 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .text 0x000000000000c064 0x216 main.obj - 0x000000000000c064 init - 0x000000000000c0ec __isr_7 - 0x000000000000c118 __isr_3 - 0x000000000000c14a Em_Message_startSend - 0x000000000000c15e Em_Message_lock - 0x000000000000c166 Em_Message_unlock - 0x000000000000c172 led0_toggle - 0x000000000000c178 led1_toggle - 0x000000000000c180 led0_on - 0x000000000000c186 led0_off - 0x000000000000c18e led1_on - 0x000000000000c196 led1_off - 0x000000000000c19e __isr_9 - 0x000000000000c1b4 initTimer - 0x000000000000c1cc stopTimer - 0x000000000000c1d4 DUREX_connectHandler - 0x000000000000c1e2 DUREX_disconnectHandler - 0x000000000000c1f0 DUREX_numBytes_fetch - 0x000000000000c1f8 DUREX_numBytes_store - 0x000000000000c1fe DUREX_data_fetch - 0x000000000000c20c DUREX_data_store - 0x000000000000c21c DUREX_numPackets_fetch - 0x000000000000c224 DUREX_numPackets_store - 0x000000000000c22a DUREX_messageAvailable_fetch - 0x000000000000c232 DUREX_messageAvailable_store - .text 0x000000000000c27a 0x432 DUREX.obj - 0x000000000000c27a Em_Message_addByte - 0x000000000000c2c2 DUREX_reset - 0x000000000000c2f0 DUREX_run - 0x000000000000c2f6 Em_App_startIndSend - 0x000000000000c310 DUREX_pairingOn - 0x000000000000c332 DUREX_pairingOff - 0x000000000000c33c DUREX_disconnect - 0x000000000000c35e DUREX_accept - 0x000000000000c37c Em_App_startResSend - 0x000000000000c396 Em_App_xmitReady - 0x000000000000c3ea Em_App_sendResponse - 0x000000000000c40e Em_App_sysStoreDispatch - 0x000000000000c428 Em_App_sysFetchDispatch - 0x000000000000c4a8 Em_App_fetchDispatch - 0x000000000000c500 Em_App_storeDispatch - 0x000000000000c550 Em_Message_dispatch - 0x000000000000c5ae Em_App_sendIndicator - 0x000000000000c5de Em_Message_getByte - 0x000000000000c694 DUREX_messageAvailable_indicate - .text 0x000000000000c6ac 0xfc /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - 0x000000000000c6ac memcpy - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .text 0x000000000000c7a8 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - .text.crt0 0x000000000000c7a8 0x2 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - 0x000000000000c7a8 _unexpected_ - 0x000000000000c7aa . = ALIGN (0x2) - -.rodata 0x000000000000c7aa 0x36 - 0x000000000000c7aa . = ALIGN (0x2) - *(.rodata .rodata.* .gnu.linkonce.r.*) - .rodata 0x000000000000c7aa 0x4 main.obj - .rodata 0x000000000000c7ae 0x32 DUREX.obj - 0x000000000000c7c2 Em_App_endian - 0x000000000000c7c4 Em_App_build - 0x000000000000c7cc Em_App_hash - 0x000000000000c7e0 . = ALIGN (0x2) - 0x000000000000c7e0 _etext = . - -.data 0x0000000000000200 0x6 load address 0x000000000000c7e0 - 0x0000000000000200 . = ALIGN (0x2) - 0x0000000000000200 PROVIDE (__data_start, .) - *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000000000000200 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .data 0x0000000000000200 0x1 main.obj - 0x0000000000000200 lastMessageAck - *fill* 0x0000000000000201 0x1 00 - .data 0x0000000000000202 0x4 DUREX.obj - 0x0000000000000202 Em_App_inBuf - 0x0000000000000204 Em_App_readIdle - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .data 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - 0x0000000000000206 . = ALIGN (0x2) - 0x0000000000000206 _edata = . - 0x000000000000c7e0 PROVIDE (__data_load_start, LOADADDR (.data)) - 0x0000000000000006 PROVIDE (__data_size, SIZEOF (.data)) - -.bss 0x0000000000000206 0x1f8 load address 0x000000000000c7e6 - 0x0000000000000206 PROVIDE (__bss_start, .) - *(.bss .bss.*) - .bss 0x0000000000000206 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - .bss 0x0000000000000206 0xec main.obj - 0x0000000000000206 messageAvailable - 0x0000000000000208 numPackets - 0x000000000000020a data - 0x00000000000002f0 numBytes - .bss 0x00000000000002f2 0x4 DUREX.obj - 0x00000000000002f2 Em_App_moreData - 0x00000000000002f4 Em_App_state - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .bss 0x00000000000002f6 0x0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - *(COMMON) - COMMON 0x00000000000002f6 0x107 DUREX.obj - 0x00000000000002f6 Em_App_recvIdx - 0x00000000000002f7 Em_App_xmitSize - 0x00000000000002f8 Em_App_outBuf - 0x00000000000002fa Em_App_ind - 0x0000000000000304 Em_App_xmitMask - 0x0000000000000308 Em_App_msg - 0x00000000000003f4 Em_App_recvSize - 0x00000000000003f6 Em_App_fileIndex - 0x00000000000003fa Em_App_pdHdlr - 0x00000000000003fc Em_App_xmitIdx - 0x00000000000003fe . = ALIGN (0x2) - *fill* 0x00000000000003fd 0x1 00 - 0x00000000000003fe PROVIDE (__bss_end, .) - 0x00000000000001f8 PROVIDE (__bss_size, SIZEOF (.bss)) - -.noinit 0x00000000000003fe 0x2 load address 0x000000000000c7e6 - 0x00000000000003fe PROVIDE (__noinit_start, .) - *(.noinit .noinit.*) - .noinit.crt0 0x00000000000003fe 0x2 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - 0x00000000000003fe __wdt_clear_value - 0x0000000000000400 . = ALIGN (0x2) - 0x0000000000000400 PROVIDE (__noinit_end, .) - 0x0000000000000400 . = ALIGN (0x2) - 0x0000000000000400 _end = . - -.infomem 0x0000000000001000 0x0 - *(.infomem) - 0x0000000000001000 . = ALIGN (0x2) - *(.infomem.*) - -.infomemnobits 0x0000000000001000 0x0 - *(.infomemnobits) - 0x0000000000001000 . = ALIGN (0x2) - *(.infomemnobits.*) - -.infoa - *(.infoa .infoa.*) - -.infob - *(.infob .infob.*) - -.infoc - *(.infoc .infoc.*) - -.infod - *(.infod .infod.*) - -.vectors 0x000000000000ffe0 0x20 - 0x000000000000ffe0 PROVIDE (__vectors_start, .) - *(.vectors*) - .vectors 0x000000000000ffe0 0x20 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o - 0x000000000000ffe0 __ivtbl_16 - 0x0000000000010000 _vectors_end = . - -.fartext 0x0000000000000000 0x0 - 0x0000000000000000 . = ALIGN (0x2) - *(.fartext) - 0x0000000000000000 . = ALIGN (0x2) - *(.fartext.*) - 0x0000000000000000 _efartext = . - -.profiler - *(.profiler) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment - *(.comment) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x0000000000000000 0xb8 - *(.debug_aranges) - .debug_aranges - 0x0000000000000000 0x18 main.obj - .debug_aranges - 0x0000000000000018 0x14 DUREX.obj - .debug_aranges - 0x000000000000002c 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .debug_aranges - 0x0000000000000040 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_aranges - 0x0000000000000054 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_aranges - 0x0000000000000068 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_aranges - 0x000000000000007c 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_aranges - 0x0000000000000090 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_aranges - 0x00000000000000a4 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_pubnames - *(.debug_pubnames) - -.debug_info 0x0000000000000000 0x13e2 - *(.debug_info) - .debug_info 0x0000000000000000 0x81b main.obj - .debug_info 0x000000000000081b 0x75a DUREX.obj - .debug_info 0x0000000000000f75 0x113 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .debug_info 0x0000000000001088 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_info 0x0000000000001117 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_info 0x00000000000011a6 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_info 0x0000000000001235 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_info 0x00000000000012c4 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_info 0x0000000000001353 0x8f /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - *(.gnu.linkonce.wi.*) - -.debug_abbrev 0x0000000000000000 0x4fd - *(.debug_abbrev) - .debug_abbrev 0x0000000000000000 0x1c0 main.obj - .debug_abbrev 0x00000000000001c0 0x22e DUREX.obj - .debug_abbrev 0x00000000000003ee 0x97 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .debug_abbrev 0x0000000000000485 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_abbrev 0x0000000000000499 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_abbrev 0x00000000000004ad 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_abbrev 0x00000000000004c1 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_abbrev 0x00000000000004d5 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_abbrev 0x00000000000004e9 0x14 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_line 0x0000000000000000 0x762 - *(.debug_line) - .debug_line 0x0000000000000000 0x194 main.obj - .debug_line 0x0000000000000194 0x211 DUREX.obj - .debug_line 0x00000000000003a5 0x10e /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - .debug_line 0x00000000000004b3 0x72 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) - .debug_line 0x0000000000000525 0x70 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) - .debug_line 0x0000000000000595 0x76 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) - .debug_line 0x000000000000060b 0x76 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) - .debug_line 0x0000000000000681 0x71 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) - .debug_line 0x00000000000006f2 0x70 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) - -.debug_frame 0x0000000000000000 0x2de - *(.debug_frame) - .debug_frame 0x0000000000000000 0x192 main.obj - .debug_frame 0x0000000000000192 0x114 DUREX.obj - .debug_frame 0x00000000000002a6 0x38 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - -.debug_str 0x0000000000000000 0x7cc - *(.debug_str) - .debug_str 0x0000000000000000 0x3c8 main.obj - 0x4c0 (size before relaxing) - .debug_str 0x00000000000003c8 0x38f DUREX.obj - 0x48e (size before relaxing) - .debug_str 0x0000000000000757 0x75 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - 0x100 (size before relaxing) - -.debug_loc 0x0000000000000000 0x59f - *(.debug_loc) - .debug_loc 0x0000000000000000 0x113 main.obj - .debug_loc 0x0000000000000113 0x29c DUREX.obj - .debug_loc 0x00000000000003af 0x1f0 /Applications/Development/Em-Builder-IDE/eclipse/emmoco/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a(memcpy.o) - -.debug_macinfo - *(.debug_macinfo) - -.debug_pubtypes - *(.debug_pubtypes) - -.debug_ranges 0x0000000000000000 0xc - *(.debug_ranges) - .debug_ranges 0x0000000000000000 0xc main.obj - 0x0000000000000400 PROVIDE (__stack, (ORIGIN (ram) + 0x200)) - 0x000000000000c7e0 PROVIDE (__data_start_rom, _etext) - 0x000000000000c7e6 PROVIDE (__data_end_rom, (_etext + SIZEOF (.data))) -OUTPUT(main.out elf32-msp430) diff --git a/DUREXLaunchpad/main.obj b/DUREXLaunchpad/main.obj deleted file mode 100644 index 2740279..0000000 --- a/DUREXLaunchpad/main.obj +++ /dev/null diff --git a/DUREXLaunchpad/main.out b/DUREXLaunchpad/main.out deleted file mode 100755 index 5a17c25..0000000 --- a/DUREXLaunchpad/main.out +++ /dev/null diff --git a/DUREXLaunchpad/makefile b/DUREXLaunchpad/makefile deleted file mode 100644 index fa44f02..0000000 --- a/DUREXLaunchpad/makefile +++ /dev/null @@ -1,8 +0,0 @@ -EMSNAME = DUREX - -COMMON = ../CommonLaunchPad -SCHEMA = ../DUREX - -OBJECTS = main.obj $(EMSNAME).obj - -include $(COMMON)/rules.mk diff --git a/ISG-DUREX/examples-12.1.1.zip b/ISG-DUREX/examples-12.1.1.zip deleted file mode 100644 index a59565d..0000000 --- a/ISG-DUREX/examples-12.1.1.zip +++ /dev/null diff --git a/ISG-DUREX/examples.tar.gz b/ISG-DUREX/examples.tar.gz new file mode 100644 index 0000000..2bb8010 --- /dev/null +++ b/ISG-DUREX/examples.tar.gz diff --git a/CommonLaunchPad/.project b/Platform-MSP-EXP430G2/.project index fa774de..3f5a75d 100644 --- a/CommonLaunchPad/.project +++ b/Platform-MSP-EXP430G2/.project @@ -1,11 +1,11 @@ - - - CommonLaunchPad - - - - - - - - + + + Platform-MSP-EXP430G2 + + + + + + + + diff --git a/Platform-MSP-EXP430G2/Hal/Hal.c b/Platform-MSP-EXP430G2/Hal/Hal.c new file mode 100644 index 0000000..d125a99 --- /dev/null +++ b/Platform-MSP-EXP430G2/Hal/Hal.c @@ -0,0 +1,400 @@ +/* + * ============ Hardware Abstraction Layer for MSP-EXP430G2 LaunchPad ============ + */ + +#include "Hal.h" +#include "Em_Message.h" + +#include + + +/* -------- INTERNAL FEATURES -------- */ + +#define LED_CONFIG() (P1DIR |= BIT6) +#define LED_ON() (P1OUT |= BIT6) +#define LED_OFF() (P1OUT &= ~BIT6) +#define LED_READ() (P1OUT & BIT6) +#define LED_TOGGLE() (P1OUT ^= BIT6) + +#define CONNECTED_LED_CONFIG() (P1DIR |= BIT0) +#define CONNECTED_LED_ON() (P1OUT |= BIT0) +#define CONNECTED_LED_OFF() (P1OUT &= ~BIT0) + +#define BUTTON_CONFIG() (P1DIR &= ~BIT3, P1REN |= BIT3, P1OUT |= BIT3, P1IES |= BIT3); +#define BUTTON_ENABLE() (P1IFG &= ~BIT3, P1IE |= BIT3) +#define BUTTON_PRESSED() (!(P1IN & BIT3)) +#define BUTTON_DEBOUNCE_MSECS 100 + +#define DEBUG1_CONFIG() (P2DIR |= BIT3) +#define DEBUG1_ON() (P2OUT |= BIT3) +#define DEBUG1_OFF() (P2OUT &= ~BIT3) + +#define DEBUG2_CONFIG() (P2DIR |= BIT4) +#define DEBUG2_ON() (P2OUT |= BIT4) +#define DEBUG2_OFF() (P2OUT &= ~BIT4) + +#define EAP_RX_BUF UCA0RXBUF +#define EAP_TX_BUF UCA0TXBUF + +#define EAP_RX_VECTOR USCIAB0RX_VECTOR +#define EAP_TX_VECTOR USCIAB0TX_VECTOR +#define EAP_TX_ACK_VECTOR PORT2_VECTOR + +#define EAP_RX_ENABLE() (P1SEL |= BIT1, P1SEL2 |= BIT1) +#define EAP_RX_DISABLE() (P1SEL &= ~BIT1, P1SEL2 &= ~BIT1) +#define EAP_TX_ENABLE() (P1SEL |= BIT2, P1SEL2 |= BIT2) +#define EAP_TX_DISABLE() (P1SEL &= ~BIT2, P1SEL2 &= ~BIT2) + +#define EAP_RX_ACK_CONFIG() (P2DIR |= BIT0) +#define EAP_RX_ACK_SET() (P2OUT |= BIT0) +#define EAP_RX_ACK_CLR() (P2OUT &= ~BIT0) + +#define EAP_TX_ACK_CONFIG() (P2DIR &= ~BIT1, P2IES |= BIT1, P2IFG &= ~BIT1, P2IE |= BIT1) +#define EAP_TX_ACK_TST() (P2IFG & BIT1) +#define EAP_TX_ACK_CLR() (P2IFG &= ~BIT1) + +#define EAP_RX_INT_CLR() (IFG2 &= ~UCA0RXIFG) +#define EAP_RX_INT_ENABLE() (IE2 |= UCA0RXIE) +#define EAP_TX_INT_CLR() (IFG2 &= ~UCA0TXIFG) +#define EAP_TX_INT_DISABLE() (IE2 &= ~UCA0TXIE) +#define EAP_TX_INT_ENABLE() (IE2 |= UCA0TXIE) + +#define MCLK_TICKS_PER_MS 1000L +#define ACLK_TICKS_PER_SECOND 12000L +#define UART_WATCHDOG_PERIOD (ACLK_TICKS_PER_SECOND * 250) / 1000 + +#define UART_WATCH_DISABLE() (TA1CCTL1 = 0) // Turn off CCR1 Interrupt +#define UART_WATCH_ENABLE() (TA1CCR1 = TA1R + UART_WATCHDOG_PERIOD, TA1CCTL1 = CCIE) // Set CCR1, and Enable CCR1 Interrupt + +#ifdef __GNUC__ +#define DINT() (__disable_interrupt()) +#define EINT() (__enable_interrupt()) +#define INTERRUPT +#define SLEEP() (_BIS_SR(LPM3_bits + GIE)) +#define WAKEUP() (_BIC_SR_IRQ(LPM3_bits)) +#endif + +#ifdef __TI_COMPILER_VERSION__ +#define DINT() (_disable_interrupt()) +#define EINT() (_enable_interrupt()) +#define INTERRUPT interrupt +#define SLEEP() (__bis_SR_register(LPM3_bits + GIE)) +#define WAKEUP() (__bic_SR_register_on_exit(LPM3_bits)) +#endif + +#define NUM_HANDLERS 3 + +#define BUTTON_HANDLER_ID 0 +#define TICK_HANDLER_ID 1 +#define DISPATCH_HANDLER_ID 2 + +static void buttonHandler(void); +static void postEvent(uint8_t handlerId); + +static Hal_Handler appButtonHandler; +static volatile uint16_t handlerEvents = 0; +static uint16_t clockTick = 0; +static Hal_Handler handlerTab[NUM_HANDLERS]; + + +/* -------- APP-HAL INTERFACE -------- */ + +void Hal_buttonEnable(Hal_Handler handler) { + handlerTab[BUTTON_HANDLER_ID] = buttonHandler; + appButtonHandler = handler; + BUTTON_CONFIG(); + Hal_delay(100); + BUTTON_ENABLE(); +} + +void Hal_connected(void) { + CONNECTED_LED_ON(); +} + +void Hal_debugOn(uint8_t line) { + switch (line) { + case 1: + DEBUG1_ON(); + break; + case 2: + DEBUG2_ON(); + } +} + +void Hal_debugOff(uint8_t line) { + switch (line) { + case 1: + DEBUG1_OFF(); + break; + case 2: + DEBUG2_OFF(); + } +} + +void Hal_debugPulse(uint8_t line) { + switch (line) { + case 1: + DEBUG1_ON(); + DEBUG1_OFF(); + break; + case 2: + DEBUG2_ON(); + DEBUG2_OFF(); + } +} + +void Hal_delay(uint16_t msecs) { + while (msecs--) { + __delay_cycles(MCLK_TICKS_PER_MS); + } +} + +void Hal_disconnected(void) { + CONNECTED_LED_OFF(); +} + +void Hal_init(void) { + + /* setup clocks */ + + WDTCTL = WDTPW + WDTHOLD; + BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0; + if (CALBC1_1MHZ != 0xFF) { + DCOCTL = 0x00; + BCSCTL1 = CALBC1_1MHZ; /* Set DCO to 1MHz */ + DCOCTL = CALDCO_1MHZ; + } + BCSCTL1 |= XT2OFF + DIVA_0; + BCSCTL3 = XT2S_0 + LFXT1S_2 + XCAP_1; + + /* setup LEDs */ + + LED_CONFIG(); + LED_OFF(); + CONNECTED_LED_CONFIG(); + CONNECTED_LED_OFF(); + + /* setup debug pins */ + + DEBUG1_CONFIG(); DEBUG1_OFF(); + DEBUG2_CONFIG(); DEBUG2_OFF(); + + DEBUG1_ON(); DEBUG1_OFF(); + + /* setup TimerA1 */ + TA1CTL = TASSEL_1 + MC_2; // ACLK, Continuous mode + UART_WATCH_ENABLE(); + + /* setup UART */ + + UCA0CTL1 |= UCSWRST; + + EAP_RX_ENABLE(); + EAP_TX_ENABLE(); + + EAP_RX_ACK_CONFIG(); + EAP_RX_ACK_SET(); + + EAP_TX_ACK_CONFIG(); + + // suspend the MCM + EAP_RX_ACK_CLR(); + + UCA0CTL1 = UCSSEL_2 + UCSWRST; + UCA0MCTL = UCBRF_0 + UCBRS_6; + UCA0BR0 = 8; + UCA0CTL1 &= ~UCSWRST; + + handlerTab[DISPATCH_HANDLER_ID] = Em_Message_dispatch; +} + +void Hal_idleLoop(void) { + + EINT(); + for (;;) { + + // atomically read/clear all handlerEvents + DINT(); + uint16_t events = handlerEvents; + handlerEvents = 0; + + if (events) { // dispatch all current events + EINT(); + uint16_t mask; + uint8_t id; + for (id = 0, mask = 0x1; id < NUM_HANDLERS; id++, mask <<= 1) { + if ((events & mask) && handlerTab[id]) { + handlerTab[id](); + } + } + } + else { // await more events + SLEEP(); + } + } +} + +void Hal_ledOn(void) { + LED_ON(); +} + +void Hal_ledOff(void) { + LED_OFF(); +} + +bool Hal_ledRead(void) { + return LED_READ(); +} + +void Hal_ledToggle(void) { + LED_TOGGLE(); +} + +void Hal_tickStart(uint16_t msecs, Hal_Handler handler) { + handlerTab[TICK_HANDLER_ID] = handler; + clockTick = (ACLK_TICKS_PER_SECOND * msecs) / 1000; + TA1CCR0 = TA1R + clockTick; // Set the CCR0 interrupt for msecs from now. + TA1CCTL0 = CCIE; // Enable the CCR0 interrupt +} + + +/* -------- SRT-HAL INTERFACE -------- */ + +uint8_t Em_Hal_lock(void) { + #ifdef __GNUC__ + uint8_t key = READ_SR & 0x8; + __disable_interrupt(); + return key; + #endif + #ifdef __TI_COMPILER_VERSION__ + uint8_t key = _get_interrupt_state(); + _disable_interrupt(); + return key; + #endif +} + +void Em_Hal_reset(void) { + uint8_t key = Em_Hal_lock(); + EAP_RX_ACK_CLR(); // suspend the MCM + Hal_delay(100); + EAP_RX_ACK_SET(); // reset the MCM + Hal_delay(500); + EAP_RX_INT_CLR(); + EAP_TX_INT_CLR(); + EAP_TX_ACK_CLR(); + EAP_RX_INT_ENABLE(); + Em_Hal_unlock(key); +} + +void Em_Hal_startSend() { + EAP_TX_BUF = Em_Message_startTx(); +} + +void Em_Hal_unlock(uint8_t key) { + #ifdef __GNUC__ + __asm__("bis %0,r2" : : "ir" ((uint16_t) key)); + #endif + #ifdef __TI_COMPILER_VERSION__ + _set_interrupt_state(key); + #endif +} + +void Em_Hal_watchOff(void) { + UART_WATCH_DISABLE(); +} + +void Em_Hal_watchOn(void) { + UART_WATCH_ENABLE(); +} + + +/* -------- INTERNAL FUNCTIONS -------- */ + +static void buttonHandler(void) { + Hal_delay(100); + if (BUTTON_PRESSED() && appButtonHandler) { + appButtonHandler(); + } +} + +static void postEvent(uint8_t handlerId) { + uint8_t key = Em_Hal_lock(); + handlerEvents |= 1 << handlerId; + Em_Hal_unlock(key); +} + +/* -------- INTERRUPT SERVICE ROUTINES -------- */ + +#ifdef __GNUC__ + __attribute__((interrupt(PORT1_VECTOR))) +#endif +#ifdef __TI_COMPILER_VERSION__ + #pragma vector=PORT1_VECTOR +#endif +INTERRUPT void buttonIsr(void) { + postEvent(BUTTON_HANDLER_ID); + BUTTON_ENABLE(); + WAKEUP(); +} + +#ifdef __GNUC__ + __attribute__((interrupt(EAP_RX_VECTOR))) +#endif +#ifdef __TI_COMPILER_VERSION__ + #pragma vector=EAP_RX_VECTOR +#endif +INTERRUPT void rxIsr(void) { + uint8_t b = EAP_RX_BUF; + Em_Message_startRx(); + EAP_RX_ACK_CLR(); + EAP_RX_ACK_SET(); + if (Em_Message_addByte(b)) { + postEvent(DISPATCH_HANDLER_ID); + } + WAKEUP(); +} + +#ifdef __GNUC__ + __attribute__((interrupt(TIMER1_A0_VECTOR))) +#endif +#ifdef __TI_COMPILER_VERSION__ + #pragma vector=TIMER1_A0_VECTOR +#endif +INTERRUPT void timerIsr(void) { + TA1CCR0 += clockTick; + postEvent(TICK_HANDLER_ID); + WAKEUP(); +} + +#ifdef __GNUC__ + __attribute__((interrupt(EAP_TX_ACK_VECTOR))) +#endif +#ifdef __TI_COMPILER_VERSION__ + #pragma vector=EAP_TX_ACK_VECTOR +#endif +INTERRUPT void txAckIsr(void) { + if (EAP_TX_ACK_TST()) { + uint8_t b; + if (Em_Message_getByte(&b)) { + EAP_TX_BUF = b; + } + EAP_TX_ACK_CLR(); + } + WAKEUP(); +} + +#ifdef __GNUC__ + __attribute__((interrupt(TIMER1_A1_VECTOR))) +#endif +#ifdef __TI_COMPILER_VERSION__ + #pragma vector=TIMER1_A1_VECTOR +#endif +INTERRUPT void uartWatchdogIsr(void) { + switch (TA1IV) { + case 2: // CCR1 + UART_WATCH_DISABLE(); + Em_Message_restart(); + WAKEUP(); + break; + } +} diff --git a/Platform-MSP-EXP430G2/Hal/Hal.h b/Platform-MSP-EXP430G2/Hal/Hal.h new file mode 100644 index 0000000..f166774 --- /dev/null +++ b/Platform-MSP-EXP430G2/Hal/Hal.h @@ -0,0 +1,305 @@ +/** + * Hal.h -- HAL Interface Definitions + * + * This example HAL is intentionally simple. The implementation is limited to: + * + * BUTTON -- a single button that when pressed will cause an interrupt. + * CONNECTED_LED -- an LED that is controlled inside the HAL to indicate connection to a central. + * DEBUG -- two debug GPIOs that are available as outputs from the EAP and under user control. + * DELAY -- a delay routine that can delay by n milliseconds. + * INIT -- set the hardware up to its initial state + * LED -- a user LED that is available for application control. + * TICK -- a timer that can be set to interrupt every n milliseconds + * IDLE LOOP -- an event driven idle loop for controlling the EAP + * + * For information on Hal implementations for specific target hardware platforms, + * visit the http://wiki.em-hub.com/display/ED. + * + **/ + +#ifndef Hal__H +#define Hal__H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*Hal_Handler)(void); + +/** + * --------- Hal_buttonEnable --------- + * + * Enable the button interrupt and connect it to the user's buttonHandler + * + * When the button is pressed, it will cause an interrupt that will cause BUTTON event + * to be entered into the event list. Once dispatched by the idle loop, the user's + * buttonHandler will be called. + * + * Inputs: + * buttonHandler - pointer to the user's handler to be called after interrupt + * + * Returns: + * None + * + * Side effects: + * BUTTON interrupt enabled + * + **/ +extern void Hal_buttonEnable(Hal_Handler handler); +/** + * --------- Hal_connected --------- + * + * Called whenever the MCM peripheral connects to a central. + * + * Turns on the CONNECTED_LED to show connectivity to the central + * Could do other things associated with connection to the central. + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * CONNECTED_LED on. + * + **/ +extern void Hal_connected(void); +/** + * --------- Hal_debugOff --------- + * + * Turns the selected DEBUG line off. + * + * The two DEBUG lines are output GPIOs that are available to the user for + * debug purposes. + * + * Inputs: + * line - the index value of the debug line to turn off + * + * Returns: + * None + * + * Side Effects: + * DEBUG line off. + * + **/ +extern void Hal_debugOff(uint8_t line); +/** + * --------- Hal_debugOn --------- + * + * Turns the selected DEBUG line on. + * + * The two DEBUG lines are output GPIOs that are available to the user for + * debug purposes. + * + * Inputs: + * line - the index value of the debug line to turn on + * + * Returns: + * None + * + * Side Effects: + * DEBUG line on. + * + **/ +extern void Hal_debugOn(uint8_t line); +/** + * --------- Hal_debugPulse --------- + * + * Emits a pulse on the selected DEBUG line. + * + * The two DEBUG lines are output GPIOs that are available to the user for + * debug purposes. + * + * Inputs: + * line - the index value of the debug line to emit a pulse + * + * Returns: + * None + * + * Side Effects: + * DEBUG line turns on then off. + * + **/ +extern void Hal_debugPulse(uint8_t line); +/** + * --------- Hal_delay --------- + * + * Delays for the specified number of milliseconds. + * + * In this example, delay is done with CPU spinning for simplicity's sake. + * This could easily use a timer interrupt for more power savings. + * + * Inputs: + * msecs - the number of milliseconds to delay + * + * Returns: + * None + * + * Side Effects: + * None + * + **/ +extern void Hal_delay(uint16_t msecs); +/** + * --------- Hal_disconnected --------- + * + * Called whenever the MCM peripheral disconnects from a central. + * + * Turns off the CONNECTED_LED to show lack of connectivity to the central + * Could do other things associated with connection to the central. + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * CONNECTED_LED off. + * + **/ +extern void Hal_disconnected(void); +/** + * --------- Hal_idleLoop --------- + * + * The idle loop that controls EAP operations. + * + * The hal implements an event driven "idle loop" scheduler. + * When there are no events pending, the idle loop sleeps. + * When an event happens, the idle loop wakes up, and dispatches + * to the appropriate event handler. + * + * The dispatching is done through a handlerTab that has one entry for each type of event. + * Each handlerTab entry should be a handler of type hal_handler *. + * There are currently three types of events, i.e. entries in the handlerTab: + * BUTTON_HANDLER_ID: handler to call upon a button press + * TICK_HANDLER_ID: handler to call upon a timer interrupt + * DISPATCH_HANDLER_ID: handler to call upon a received message from the MCM + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * dispatches events as they come in + * + **/ +extern void Hal_idleLoop(void); +/** + * --------- Hal_init --------- + * + * Initialize the hardware + * + * Initializes the EAP and MCM into their reset state. Should be called first. + * Sets up the clock, ports, watchdog timer, etc. + * + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * EAP and MCM in their initial state. + * + **/ +extern void Hal_init(void); +/** + * --------- Hal_ledOff --------- + * + * Turns the user LED off. + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * User LED off. + * + **/ +extern void Hal_ledOff(void); +/** + * --------- Hal_ledOn --------- + * + * Turns the user LED on. + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * User LED on. + * + **/ +extern void Hal_ledOn(void); +/** + * --------- Hal_ledRead --------- + * + * Returns the user LED state. + * + * Inputs: + * None + * + * Returns: + * Bool - (true = user LED is on, false = user LED is off) + * + * Side Effects: + * None + * + **/ +extern bool Hal_ledRead(void); +/** + * --------- Hal_ledToggle --------- + * + * Toggles the user LED. + * + * Inputs: + * None + * + * Returns: + * None + * + * Side Effects: + * User LED toggles state. + * + **/ +extern void Hal_ledToggle(void); +/** + * --------- Hal_tickStart --------- + * + * Sets up the timer to interrupt every msecs milliseconds and the user's tickHandler + * that will be called upon interrupt. + * + * Enable a timer interrupt every msecs ms. The interrupt will cause a TICK event + * to be entered into the event list. Once dispatched by the idle loop, the user's + * tickHandler will be called. + * + * Inputs: + * msecs - the number of milliseconds between tick interrupts + * tickHandler - the address of the user's tick handler that will be called + * + * Returns: + * None + * + * Side Effects: + * tickhandler called by the idle loop + * + **/ +extern void Hal_tickStart(uint16_t msecs, Hal_Handler Handler); + +#ifdef __cplusplus +} +#endif + +#endif /* Hal__H */ diff --git a/Platform-MSP-EXP430G2/common.mk b/Platform-MSP-EXP430G2/common.mk new file mode 100644 index 0000000..e1c3331 --- /dev/null +++ b/Platform-MSP-EXP430G2/common.mk @@ -0,0 +1,80 @@ +OUTDIR = Output +EMMOCO-ROOT = /Applications/Development/Em-Builder-IDE/eclipse/emmoco +EMBUILDER ?= +SCHEMAFILE = $(APPNAME).ems +MAIN = $(APPNAME)-Prog +BINFILE = $(OUTDIR)/$(MAIN).bin +HEXFILE = $(OUTDIR)/$(MAIN).hex +OUTFILE = $(OUTDIR)/$(MAIN).out +OBJECTS = $(OUTDIR)/$(MAIN).obj $(OUTDIR)/$(APPNAME).obj $(OUTDIR)/Hal.obj + +CC = $(TOOLS)/$(GCCARCH)-gcc +LD = $(TOOLS)/$(GCCARCH)-ld +OBJCOPY = $(TOOLS)/$(GCCARCH)-objcopy +SIZE = $(TOOLS)/$(GCCARCH)-size + +CFLAGS = -std=gnu99 -O2 -w -ffunction-sections -fdata-sections -fpack-struct=1 -fno-strict-aliasing -fomit-frame-pointer -c -g -I$(PLATFORM)/Hal -IEm $(COPTS) + +load: out-check + $(EXEC) + +build: $(OUTDIR) out-remove $(OUTFILE) + +$(OUTDIR): +ifeq (,$(findstring Windows,$(OS))) + mkdir $(OUTDIR) +else + cmd /c mkdir $(OUTDIR) +endif + +$(OUTDIR)/$(MAIN).obj: $(MAIN).c Em/$(APPNAME).c + $(CC) $< -o $@ $(CFLAGS) + +$(OUTDIR)/$(APPNAME).obj: Em/$(APPNAME).c + $(CC) $< -o $@ $(CFLAGS) + +$(OUTDIR)/Hal.obj: $(PLATFORM)/Hal/Hal.c + $(CC) $< -o $@ $(CFLAGS) + +Em/$(APPNAME).c: $(SCHEMAFILE) +ifneq (,$(EMBUILDER)) + $(EMBUILDER) -v --root=$(&2 + @exit 1 +endif + +local-clean: +ifeq (,$(findstring Windows,$(OS))) + rm -rf $(OUTDIR) +else +ifneq (,$(wildcard $(OUTDIR))) + cmd /c rmdir /q /s $(subst /,\,$(OUTDIR)) +endif +endif + +clean: local-clean +ifeq (,$(findstring Windows,$(OS))) + rm -rf $(EM) +else +ifneq (,$(wildcard Em)) + cmd /c rmdir /q /s $(subst /,\,Em) +endif +endif + +out-check: +ifeq (,$(wildcard $(OUTFILE))) + @echo error: $(OUTFILE): No such file or directory 1>&2 + @exit 1 +endif + +out-remove: +ifeq (,$(findstring Windows,$(OS))) + rm -f $(OUTFILE) +else +ifneq (,$(wildcard $(OUTFILE))) + cmd /c del /q $(subst /,\,$(OUTFILE)) +endif +endif + +.PHONY: all load clean local-clean out-check diff --git a/Platform-MSP-EXP430G2/rules.mk b/Platform-MSP-EXP430G2/rules.mk new file mode 100644 index 0000000..2eb8f99 --- /dev/null +++ b/Platform-MSP-EXP430G2/rules.mk @@ -0,0 +1,22 @@ +include $(PLATFORM)/common.mk + +TOOLS ?= $(EMMOCO-ROOT)/msptools/bin +GCCARCH = msp430 +MCU = msp430g2553 + +COPTS = -mmcu=$(MCU) +LDOPTS = -mmcu=$(MCU) -Wl,-Map=$(OUTDIR)/$(MAIN).map,--gc-sections + +ifeq (,$(findstring Windows,$(OS))) +EXEC = $(EMMOCO-ROOT)/msptools/bin/mspdebug rf2500 "prog $(OUTFILE)" 2>&1 +else +EXEC = $(EMMOCO-ROOT)/msptools/bin/MSP430Flasher -i USB -m AUTO -e ERASE_MAIN -n $(MCU) -w $(HEXFILE) -v -z [VCC] -g -s -q +endif + +$(OUTFILE): $(OBJECTS) + $(CC) -o $(OUTFILE) $^ $(LDOPTS) + $(OBJCOPY) -O ihex $(OUTFILE) $(HEXFILE) + $(SIZE) $(OUTFILE) + + +