Error on program space need help.

I face below error cause by program space, I am surprise because my program just a few line. I am using ATTiny2313.

I cant understand where is the error ?

-----------------------------------Error --------------------------------------------

Arduino: 1.8.2 (Windows 8.1), Board: "ATtiny2313/4313, Disabled, ATtiny2313, 1 MHz (internal), B.O.D. Disabled, no"

E:\Arduino-MyProgram\interrupt\interrupt.ino: In function 'void setup()':

E:\Arduino-MyProgram\interrupt\interrupt.ino:12:24: warning: integer overflow in expression [-Woverflow]

t.pulse(ledPin, 1601000, HIGH);//1 min HIGH

^

Sketch uses 1500 bytes (73%) of program storage space. Maximum is 2048 bytes.
Global variables use 184 bytes (143%) of dynamic memory, leaving -56 bytes for local variables. Maximum is 128 bytes.
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
Error compiling for board ATtiny2313/4313.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I have a very short program, may i know why space not enough.

#include <Timer.h>

Timer t;
const byte ledPin = 0;
const byte interruptPin = 4;
volatile bool flag = false;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(interruptPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(interruptPin), setflag, FALLING);
  t.pulse(ledPin, 1*60*1000, HIGH);//1 min HIGH
}

void loop() {
  if (flag) {
  t.update(); 
  
  flag=false;
  }
}

void setflag(){
  flag = true;
}

1601000 = 60000.

An int value is between: -32768 to 32767

A signed int is between -32768 and 32767, an unsigned int is between 0 and 65,535 on most, but not all, Arduinos

What type of variable does the pulse function take ?

Where did you get Timer.h? It doesn't compile with the timer.h (note case) I have on my machine.

The timer.h library is from Dr. Simon Monk website here. It does not use build in hardware timer. It only use millis.

I check the library timer.h public. Copy to below

int8_t pulse(uint8_t pin, unsigned long period, uint8_t startingValue);

It look like the variable period is unsigned long not integer.

Some of the program they used can up to 10 minutes.

The library timer.h and timer.cpp is attached.

Could this be due to 2K memory size of 2313 not sufficient for the library ? If I dont use all the library function, those functions shall not be taking my memory space correct ?

Timer.cpp (3.57 KB)

Timer.h (2.17 KB)

I attached the verbose error output on compilation.

2313space-error.txt (22.7 KB)