Updated atmega168 project files.

This commit is contained in:
skarg
2007-08-16 22:13:57 +00:00
parent 62d557a58d
commit 07816a3fd5
8 changed files with 43 additions and 19 deletions
+4 -2
View File
@@ -75,7 +75,8 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=$(TARGET).map,-L=.,-l$(TARGET)
#LDFLAGS += -Wl,-Map=$(TARGET).map,-L=.,-l$(TARGET)
LDFLAGS += -Wl,-Map=$(TARGET).map
## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom
@@ -84,7 +85,8 @@ HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
## Objects that must be built in order to link
OBJECTS = $(COBJ) $(DEMOOBJ)
#OBJECTS = $(COBJ) $(DEMOOBJ)
OBJECTS = $(COBJ)
## Build
TARGET_ELF=$(TARGET).elf
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -40,12 +40,12 @@ uint16_t MSTP_Packets = 0;
/* local MS/TP port data - shared with RS-485 */
static volatile struct mstp_port_struct_t MSTP_Port;
/* receive buffer */
static DLMSTP_PACKET Receive_Packet;
static DLMSTP_PACKET Transmit_Packet;
/* buffers needed by mstp port struct */
static uint8_t TxBuffer[MAX_MPDU];
static uint8_t RxBuffer[MAX_MPDU];
/* buffers used by the datalink layer */
static DLMSTP_PACKET Receive_Packet;
static DLMSTP_PACKET Transmit_Packet;
#define INCREMENT_AND_LIMIT_UINT16(x) {if (x < 0xFFFF) x++;}
Binary file not shown.
+23 -1
View File
@@ -36,6 +36,26 @@
void init(void)
{
/* Initialize the Clock Prescaler for ATmega48/88/168 */
/* The device is shipped with the CKDIV8 Fuse programmed */
/* The default CLKPSx bits are factory set to 0011 */
/* Enbable the Clock Prescaler */
CLKPR = _BV(CLKPCE);
/* CLKPS3 CLKPS2 CLKPS1 CLKPS0 Clock Division Factor
------ ------ ------ ------ ---------------------
0 0 0 0 1
0 0 0 1 2
0 0 1 0 4
0 0 1 1 8
0 1 0 0 16
0 1 0 1 32
0 1 1 0 64
0 1 1 1 128
1 0 0 0 256
1 x x x Reserved
*/
/* Set the CLKPS3..0 bits to Prescaler of 1 */
CLKPR = 0;
/* Initialize I/O ports */
/* For Port DDRx (Data Direction) Input=1, Output=1 */
/* For Port PORTx (Bit Value) TriState=0, High=1 */
@@ -66,7 +86,9 @@ void task_milliseconds(void)
while (Timer_Milliseconds) {
Timer_Milliseconds--;
/* add other millisecond timer tasks here */
#if defined(BACDL_MSTP)
dlmstp_millisecond_timer();
#endif
}
}
@@ -90,7 +112,7 @@ int main(void)
/* BACnet handling */
pdu_len = datalink_receive(&src, &PDUBuffer[0], MAX_MPDU, 0);
if (pdu_len) {
npdu_handler(&src, &PDUBuffer[0], pdu_len);
//npdu_handler(&src, &PDUBuffer[0], pdu_len);
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ void RS485_Send_Frame(
/* delay after reception - per MS/TP spec */
if (mstp_port) {
/* wait about 40 bit times since reception */
turnaround_time = (40UL*1000UL)/RS485_Baud;
turnaround_time = (Tturnaround*1000UL)/RS485_Baud;
if (!turnaround_time) {
turnaround_time = 1;
}
Binary file not shown.